Can it cause problems when using reflection in a web service?

Discussion in 'ASP .Net Web Services' started by grompl, Jun 22, 2006.

  1. grompl

    grompl Guest

    I want to read an xml file that is located in the directory of the web
    service (c:\inetpub\wwwroot\WLSService\). I've written this little test
    method:

    <WebMethod()> Public Function openregwls() As String
    Dim path As String =
    System.Reflection.Assembly.GetExecutingAssembly.CodeBase
    path = path.Substring(0, path.LastIndexOf("/"c)) 'bin path
    path = path.Substring(0, path.LastIndexOf("/"c) + 1) 'root
    path of web service

    Dim xmlDoc As New Xml.XmlDocument
    xmlDoc.Load(path & "reg.wls")


    Return xmlDoc.OuterXml
    End Function

    it works fine on my machine, but can it cause problems on other
    machines like permission or security exeptions?
    grompl, Jun 22, 2006
    #1
    1. Advertising

  2. Well unless you have altered the settings of your server it should work
    just as fine on another default server
    as ASP.net is always running under a seperate account ( also on your dev
    machine )


    I have made webservice that even access XML files that are on a different
    server as the webservice but on the same private network
    and exposed them to the web this can be done with the right security
    settings on the fileshare path and the asp.net worker process account

    however copying this webservice to another server does require the
    alteration of settings on the new server


    regards

    Michel Posseth [MCP]


    "grompl" <> schreef in bericht
    news:...
    >I want to read an xml file that is located in the directory of the web
    > service (c:\inetpub\wwwroot\WLSService\). I've written this little test
    > method:
    >
    > <WebMethod()> Public Function openregwls() As String
    > Dim path As String =
    > System.Reflection.Assembly.GetExecutingAssembly.CodeBase
    > path = path.Substring(0, path.LastIndexOf("/"c)) 'bin path
    > path = path.Substring(0, path.LastIndexOf("/"c) + 1) 'root
    > path of web service
    >
    > Dim xmlDoc As New Xml.XmlDocument
    > xmlDoc.Load(path & "reg.wls")
    >
    >
    > Return xmlDoc.OuterXml
    > End Function
    >
    > it works fine on my machine, but can it cause problems on other
    > machines like permission or security exeptions?
    >
    Michel Posseth [MCP], Jun 24, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad

    CSS Classes can cause problems

    tshad, Mar 9, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,072
    Patrick Olurotimi Ige
    Mar 9, 2005
  2. Per Bolmstedt
    Replies:
    4
    Views:
    376
    Per Bolmstedt
    Dec 14, 2006
  3. Kobu
    Replies:
    10
    Views:
    605
    Keith Thompson
    Mar 4, 2005
  4. vl106

    can "if (ptr)" cause problems?

    vl106, Nov 17, 2006, in forum: C Programming
    Replies:
    6
    Views:
    1,254
  5. Ray Deese

    Managed C++ Web Service - strange reflection problems

    Ray Deese, May 6, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    120
    Ray Deese
    May 6, 2004
Loading...

Share This Page