Kishore Kumar
Kishore Kumar

Reputation: 12884

WCF - The remote server returned an unexpected response: (405) Method Not Allowed

I am using an external WSDL file for a WCF Service.

<wsdl:service n<wsdl:service name="CommonService">
    <wsdl:port name="BasicHttpBinding_ICommonService" binding="tns:BasicHttpBinding_ICommonService">
      <soap:address location="http://localhost:1371/CommonService.wsdl"/>
    </wsdl:port>
</wsdl:service>

When i add a service reference to this servie, i get an error in the client as Method Not Allowed.

But when i remove the above code from WSDL file and replace the same with this, it works fine. Whats the problem. Can anyone identify the reson behind this.

<wsdl:service name="CommonService">
    <wsdl:port name="BasicHttpBinding_ICommonService" binding="tns:BasicHttpBinding_ICommonService">
      <soap:address location="http://localhost:1371/Service.svc"/>
    </wsdl:port>
</wsdl:service>

Upvotes: 0

Views: 4977

Answers (1)

Davin Tryon
Davin Tryon

Reputation: 67326

I would think that it is the fact you don't expose a handler for .wsdl extension in IIS. Or you do not have a way to map that extension on. Usually, the wsdl in a WCF service is found at .svc?wsdl.

Sorry if I'm stating the obvious, but the reason looks to be changing the location from this:

http://localhost:1371/CommonService.wsdl

To this:

http://localhost:1371/Service.svc

Upvotes: 3

Related Questions