wsHttpBinding on the wcf service and web reference

2019-07-20 05:10发布

问题:

I am using wsHttpBinding with a WCF service.

I've added a web reference and I've got the web proxy (it is based on SoapHttpClientProtocol).

Also I've tried to build a proxy using wsdl.exe and the actual wsdl generated by the wcf service (http://zzzz/zz.svc?wsdl).

When the client calls the service, I get the following error:

The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 'http://tempuri.org/Service1/Operation1'.

Why doesn't the client (the web proxy) work with my WCF service?

What steps should I take to make them work?

I am running .NET FW 3.5 and ASP.NET 2.0.

回答1:

You cannot consume service exposed on wsHttpBinding with default configuration by old ASMX proxy. You must either use add service reference / svcutil or change your binding to basicHttpBinding. Default configuration of wsHttpBinding uses advanced security and ASMX doesn't support it.