CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2003
    Location
    Corvallis, OR
    Posts
    315

    Prevent outside world from using asmx file

    I have a webservice that I developed using VS2005. I then created a front end application that will make calls to the asmx page.

    The webservice (asmx file) has many functions that are proprietary and i would only like them to be called by MY front end application. However, in order to make calls to the asmx file, I have to publish the asmx file to a public location... Lets say http://myservice.mydomain.com/subdir/mywebservice.asmx.

    Now how do I keep other people from accessing this webservice while still allowing my front end app to access it?

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Prevent outside world from using asmx file

    If you need some kind of security in your webservice then you will have to implement authentication in th web service itself. This way only those users will be able to access the webservice who are authorized to do so.

    Read some stuff on autherntication here
    http://www.google.co.in/search?hl=en...tication&meta=

  3. #3
    Join Date
    Dec 2005
    Location
    Waterloo ON
    Posts
    545

    Re: Prevent outside world from using asmx file

    You could create the web service in your webapp if only this webapp can call the web service, so the web service and the webapp use the same authentication rule.

  4. #4
    Join Date
    May 2003
    Location
    Corvallis, OR
    Posts
    315

    Re: Prevent outside world from using asmx file

    I realized that I had "Enable Anonymous Access" turned ON in IIS mgr. This was allowing any Tom, ****, and Harry to run my asmx via the anonymous IUSR_MACHINENAME acct.

    After doing that I realized that even my front end app had been blocked. So I instansiate my webservice from my front end app using the following code...
    Code:
    TestServer.Service svc = new TestService.TestServer.Service();
    svc.Credentials = new System.Net.NetworkCredential("goodUserName","goodPassword","myDomain.com");            
    lblTest.Text = svc.RunTest();
    Is this ok?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured