Search code examples
asp.net.netweb-servicesiisasmx

Web Service Deployment to Production Server


I have a old style .NET Web Service running in IIS correctly on my local machine:

http://localhost/MyService/MyService/Service1.asmx

I added a Web Reference and set it's property to dynamic so that I could simply change the URL in the Web.config file. Prior to deploying to staging server, I configured it thus:

<client>
  <endpoint address="http://staging.myserver.net/WSTest/WSTest/Service1.asmx"
    binding="basicHttpBinding" bindingConfiguration="Service1Soap"
    contract="ServiceReference1.Service1Soap" name="Service1Soap" />
</client>

I can access it on the server like this and it works:

http://staging.myserver.net/MyService/service1.asmx

However, I need it to resolve like the following as this is how external clients are accessing it:

http://staging.myserver.net/MyService/MyService/service1.asmx

I can see nothing wrong with the IIS configuration settings on my staging server. Am I missing something?


Solution

  • Generally speaking, you are free to set up applications under a website, even in nested way.

    Website
    |
    --Application MyService
      |
      --Application MyService (here you host the .asmx)
    

    Like you discovered, it is very easy to achieve.

    However, there are a few red flags,

    1. .asmx is too old, and most people upgrade to REST/Graph based web API.
    2. Nested applications are still rare (or unnecessary). In most cases you should aim at short URLs. But since it is your external users who demand such URL pattern, you might not have a way to convince them.