Troubleshooting a Web Service SoapException

I recently encountered this exception consuming a web service from an application:

System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: http://service.foo.com/baa.asmx

The code ran fine locally and only caused an exception running on the web server. Initially I thought it could be to do with the web server running a newer version of the .NET framework. But this proved not to be the case.

Eventually I got the issue tracked down and it was a simple typo in the settings on the live environment. The system has the web service addresses stored in a database and the application assigns these dynamically at runtime (via the Url property). We have it set-up this way to enable the test application to send to a different end point from the live application. However this does rely on the same service being available on the end point and in this case it wasn’t.

So we were changing the URL to be:

http://service.foo.com/baa.asmx

But it needed to point to here instead:

http://service.foo.com/baas.asmx

Note the s on the end of the service method name, one little character causing one pesky SOAP exception!

Comments

Copyright © 2016 - Hook Technologies Ltd - Powered by Octopress