views:

8179

answers:

3

I've got a siluation where i need to access a SOAP web service with WSE 2.0 security. I've got all the generated c# proxies (which are derived from Microsoft.Web.Services2.WebServicesClientProtocol), i'm applying the certificate but when i call a method i get an error:

System.Net.WebException : The request failed with HTTP status 405: Method Not Allowed.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

I've done some googling and it appears that this is a server configuration issue. However this web service is used many clients without any problem (the web service is provided by a Telecom New Zealand, so it's bound to be configured correctly. I believe it's written in Java)

Can anyone shed some light on this issue?

A: 

hmm are those other clients also using C#/.NET?

Method not allowed --> could this be a REST service, instead of a SOAP web service?

cruizer
Don't know if othe rclients are also using .NET. Will checkIt's a SOAP web service.
Muxa
If the proxies were generated from WSDL then it'll be a SOAP web service.
Kev
+2  A: 

Ok, found what the problem was. I was trying to call a .wsdl url instead of .asmx url. Doh!

Muxa
A: 

I had the same problem, but the details were different:

The Url we were using didn't have the file (.asmx) part. Calling the Url in a browser was OK. It also worked in a simple client setting the URL through Visual Studio. But it didn't worked setting the Url dynamically! It gave the same 405 error.

Finally we found that adding the file part to the Web Service Url solved the problem. Maybe a .Net framework bug?

Juan Calero