WCF The request failed with HTTP status 405: Method Not Allowed
Asked Answered
T

3

7

I have a WCF service that has been hosted on a Windows Service and uses the BasicHttp endpoint to serve Windows Mobile devices that has been connected to it.

The problem is that with the Device Emulator. I can connect to the service and using it without any problems, but with an actual device. I receive the error:

WCF The request failed with HTTP status 405: Method Not Allowed.

I have used following code to implement the service.

BasicHttpBinding basicHttpBinding = new BasicHttpBinding();
basicHttpBinding.UseDefaultWebProxy = false;

m_ServiceHost.AddServiceEndpoint(typeof(IKooft), basicHttpBinding, "KooftService");
m_ServiceHost.Open();

How can I solve this problem?

Tantara answered 15/12, 2008 at 14:17 Comment(0)
M
4

Check your IIS extensions, particularly those for .wsdl are valid:

In IIS:

  • Look at the properties for your site.
  • In the Home Directory tab, click configuration.
  • Click add (my path is "C:\Program Files (x86)\Common Files\MSSOAP\BINARIES\SOAPIS30.DLL" )
  • Set the extension to .WSDL and allow "Get" and "Post"
  • Select "Script Engine" and "Verify That File Exists"

That should be it.

Maury answered 19/1, 2009 at 16:42 Comment(3)
As I mentioned, it is hosted on a Windows Service application not IIS.Tantara
SOAPIS30.DLL is missing on my development box and I am experiencing a similar issue. Do you have any idea where I can get that DLL from? What SDK is it part of?Roundish
To answer my own question that DLL comes from the deprecated Microsoft SOAP Toolkit.Roundish
L
1

If you are using a WCF REST service, you should define your contract method like this:

[OperationContract]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json)]
string CheckService();

Particularly note that WebInvoke attribute and Method="POST".

Larder answered 1/4, 2015 at 6:33 Comment(0)
L
0

When using WCF you might also need to map the .svc file type to aspnet_isapi.dll in IIS.

Landel answered 27/3, 2009 at 19:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.