views:

162

answers:

2

I have a .NET webservice running as a windows service on a Windows Server2003 R2 computer. I have a separate .NET/C# 2.0 app running that calls this webservice from elsewhere on our LAN. The webservice has 2 methods - 1 of these method calls works flawlessly. However, the other method always returns a 404 "not found" error. I can visit the webservice URL and see both methods. I did an "update web reference" on my project and it finished fine. The generated web proxy saw the method just fine. But it never works during run time, while it's sibling works just fine.

There are no web settings in the service config file - just your standard connection string and a handful of appSettings.

What on earth could cause 1 method to 404, while another works fine?

EDIT: Both the webservice and calling code is .NET 2.0, C#. This is not WCF, just old school "web reference". In fact, it's based on the System.Web.Services.Protocols.SoapHttpClientProtocol and not Microsoft.Web.Services3.WebServicesClientProtocol.

I've confirmed that the webservice url is not being set dynamically.

A: 

You don't say what technology you're using, so I'll assume it's WCF. You don't say what version of .NET you're using on the service side, so I'll assume .NET 3.5 SP1.

I recommend that you look more closely. In particular, turn on tracing and see what it has to say about it. Is the request being received? At what point is the response being generated? Perhaps the service is found, but there's something wrong with the SOAP "action", so that this second operation really is not being found. Remember that what you see in the web proxy is not the same thing that the web proxy will actually request. It should be, but may not be. Turn on tracing and find out.

You could also consider debugging the service, to see if the operation is ever reached. Perhaps an exception in the operation is being translated into the 404?

Also, look in the event logs to see if anything else interesting happened at about the same time.

John Saunders
A: 

Some code would really help us to understand your problem better. Can I ask if the app that is calling the webservice is a web app or desktop app or a windows service as well?

If its a web app, one suggestion would be to call the webservice manually and run fiddler or firebug to see what is the server response and the data that is being passed and returned. That could be a starting point for troubleshooting your problem.

Ghazaly