0
votes

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?

1
If you really need "/MyService/MyService/", set up nested applications under that website. - Lex Li
Duh! That worked. I added a virtual directory for the higher level folder, then converted the sub folder to an application and it worked. Is this the right way to do this? If so, post as answer and I'll mark it as accepted. Much appreciated. - IrishChieftain

1 Answers

1
votes

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.