Solved

Web Service Request Using localhost in the URL gives 404 error

Posted on 2006-11-03
5
622 Views
Last Modified: 2007-12-19
System:
     IIS 5.0 Windows 2000 Advanced Server.
     ASP.NET 1.1
     Multiple Layers of web services, all running on the same server.

I recently was making a minor change to a web service that had not been changed for about a year. I could not get the changes to work. I tried restoring the old source files and I still could not get it to work.

I eventually figured out that the URL I had been using for the last 3 years was causing the problem. Web service WSA called web service WSB using a dynamic URL: "http://localhost/WSB/WSB.asmx".

When I changed "localhost" to the name of the machine that both web services are on, it worked. When I changed "localhost" to "appserver", which is the string just below "localhost" in my System32\Drivers\Etc\hosts file, and which also resolves to 127.0.0.1, it also works.

When I use "localhost", I get a 404 error, and the error I get indicates that instead of looking in the directory which is defined for the application: C:\WebStuff\WSB, IIS is looking in C:\inetpub\wwwroot\WSB.

What is going on here? I am assuming that the application WSA, or at least the Web Service Proxy, had not been recompiled for over a year, and by refreshing the web service reference, I cause that recompile. But, the URL is not compiled in, it is specified at runtime.

Thanks,
David
0
Comment
Question by:anyoneis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:manav_mathur
ID: 17869499
Have yo uenabled virtual servers in IIS??
0
 
LVL 11

Author Comment

by:anyoneis
ID: 17871322
No. These web services are located on the default web site.
0
 
LVL 16

Accepted Solution

by:
manav_mathur earned 500 total points
ID: 17871341
0
 
LVL 11

Author Comment

by:anyoneis
ID: 17875528
Hmm. Well, now that you mention it... there is another web site defined called localhost. Perhaps what happened was that someone enabled it and caused my problem. If I understand virtual servers correctly, this site would get all messages referencing localhost, using the host header mechanism. But, how could it just pop up as a problem.

i am running off to ASPNET Connections for a week, so I'll look back into this in a week. Thanks for your ideas!

David

0
 
LVL 11

Author Comment

by:anyoneis
ID: 18034296
I haven't had time to test this, but I am fairly confident that manav_mathur's hypothesis is correct. So, let's close this!

Thank you!
David
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Logparser is the smartest tool I have ever used in parsing IIS log files and there are many interesting things I wanted to share with everyone one of the  real-world  scenario from my current project. Let's get started with  scenario - How do w…
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question