2

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.

icc97
  • 11,395
  • 8
  • 76
  • 90
Max
  • 47
  • 1
  • 6
  • Can you check your wsdl SoapAction address – sandyiit Jul 11 '11 at 11:51
  • Here is my WSDL: ... – Max Jul 11 '11 at 12:01
  • the definitioins are: xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" The policy: – Max Jul 11 '11 at 12:05

1 Answers1

6

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.

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670
  • Thank You very much for quick and coherent answer! Hope it helps anyone who made the same mistake... – Max Jul 11 '11 at 12:18
  • I've changed binding to basicHttpBinding, but now I get the following: System.Net.WebException: The request failed with HTTP status 415: Cannot process the message because the content type 'application/soap+xml; charset=utf-8; action="http://tempuri.org/IService1/Operation1"' was not the expected type 'text/xml; charset=utf-8'. I use SOAPUI 4.0 to test the service. WCFTestClient works fine with the service, but the ASMX proxy doesn't. But I need to use web (ASMX) proxy... – Max Jul 11 '11 at 12:25
  • It says you that you are passing request in SOAP 1.2 but the service accepts only SOAP 1.1. – Ladislav Mrnka Jul 11 '11 at 12:32
  • OK. So how can I change client for it to use SOAP 1.1? Here is my server configuration: – Max Jul 11 '11 at 12:43
  • Delete your proxy and add web reference again. `BasicHttpBinding` uses only SOAP 1.1 so the client should use it automatically. – Ladislav Mrnka Jul 11 '11 at 12:48
  • @Max: why do you want to use "Add Web Reference" at all? Just use "Add Service Reference", and you get to use any WCF binding you like. – John Saunders Jul 11 '11 at 13:38