I´m trying to consume a Soap 1.1 web service with WCF. After generating proxies with svcutil from wsdl definition, I found that the all the responses where null.
It seems that the service uses RPC Literal so WCF fallbacks to using XmlSerializer
. Here is the wsdl definition:
<wsdl:definitions xmlns:typens="http://www.myservice.es/Schemas" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.myservice.es/Schemas">
<wsdl:types>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.myservice.es/Schemas">
<xsd:include schemaLocation="../xsd/myservicetypes.xsd"/>
</xsd:schema>
</wsdl:types>
<message name="serviceRequest"/>
<message name="serviceResponse">
<part name="serviceReturn" type="typens:DateTimeResponse"/>
</message>
<portType name="QueryServiceDateTimePort">
<operation name="QueryServiceDateTime">
<input message="typens:serviceRequest"/>
<output message="typens:serviceResponse"/>
</operation>
</portType>
<binding name="QueryServiceDateTimeBinding" type="typens:QueryServiceDateTimePort">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="QueryServiceDateTime">
<soap:operation soapAction="urn:QueryServiceDateTime"/>
<input>
<soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.myservice.es/Schemas"/>
</input>
<output>
<soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.myservice.es/Schemas"/>
</output>
</operation>
</binding>
<service name="QueryServiceDateTimeService">
<port name="QueryServiceDateTimePort" binding="typens:QueryServiceDateTimeBinding">
<soap:address location="https://www.tests.com"/>
</port>
</service>
However, the service returns this response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<serviceResponse>
<serviceReturn>
<DateTime v="2013-04-20T01:13:22.001" xmlns="http://www.myservice.es/Schemas"/>
</serviceReturn>
</serviceResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Both WCF and SoapUI expect and element named QueryServiceDateTimeResponse
instead or before serviceResponse
, so they fail to deserialize or validate the response.
How can I make WCF reconice this response and deserialize it? Can I mark the proxies anyway to unwrap that element?
I should note that I can't use MessageContract in this scenario as is incompatible with RPC - Literal.