Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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?

I found this was due to WCF not being installed on IIS. The main thing is that the .svc extension has to be mapped in IIS See MSDN here. Use the ServiceModelReg tool to complete the installation. You'll always want to verify that WCF is installed and .svc is mapped in IIS anytime you get a new machine or reinstall IIS.

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

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

In my case the problem was that the app config was incorrectly formed/called: in config the service url was using "localhost" as domain name, but real hostname differed from the URL I called :( so I changed the "localhost" in config to domainname thah I use in URL. That`s all!

You needto enable HTTP Activation

Go to Control Panel > Windows Features > .NET Framework 4.5 Advanced Services > WCF Services > HTTP Activation

MethodNotAllowedEquivalent to HTTP status 405. MethodNotAllowed indicates that the request method (POST or GET) is not allowed on the requested resource.

The problem is in your enpoint uri is not full or correct addres to wcf - .scv Check your proxy.enpoint or wcf client.enpoint uri is correct.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top