While calling from my Web Application, WCF response i am getting is :
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header />
<s:Body>
<getSOAPDataResponse xmlns="http://localhost/WebServices">
<getSOAPDataResult> INFORMATION </getSOAPDataResult>
</getSOAPDataResponse>
</s:Body>
</s:Envelope>
The Web Application is very old and has some hard coded stuff that looks for “Soap” as prefix in Response.
Previously Web Services were used but now Web Services has been migrated to WCF Services.
The expected response from WCF is something like this:
<Soap:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<Soap:Header />
<Soap:Body>
<getSOAPDataResponse xmlns="http://localhost/WebServices">
<getSOAPDataResult> INFORMATION </getSOAPDataResult>
</getSOAPDataResponse>
</Soap:Body>
</Soap:Envelope>
So i need to change the WCF Response Prefix “S” to “Soap”. How can it be done. Any help will be highly appreciated.
Thanks in advance.
This blog post addresses your exact problem. You basically need to create a custom message encoder. Be aware though, if you’re using
WsHttpBindingwith message security, the approach in the post won’t work. If you’re usingBasicHttpBinding, refer to the comments at the end of the post (you need to ensure you’re replacing the right text, as the basic binding uses SOAP 1.1 and the WS binding uses SOAP 1.2).