I have one third party SOAP client that is capable of communicating with old ASMX webservices.
The problem is with a WCF services.
My WCF service receives messages from this client without problems, but the client does not like my WCF responses.
My test WCF service sends out the following response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<testResponse xmlns="http://www.tempuri.org">
<testResult>randomStringData</testResult>
</testResponse>
</s:Body>
</s:Envelope>
But the old SOAP Client expects this kind of response(ASMX service):
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<testResponse xmlns="http://tempuri.org/">
<testResult>randomStringData</testResult>
</testResponse>
</soap:Body>
</soap:Envelope>
I have no control over the client.
Is there a way i could configure my WCF to send out exactly the same message as my ASMX service does?
My WCF Service is using the following binding:
<customBinding>
<binding name="soap11">
<textMessageEncoding messageVersion="Soap11" writeEncoding="utf-8"></textMessageEncoding>
<httpTransport></httpTransport>
</binding>
</customBinding>
I managed to solve the prefix problem with custom message inspector and with BeforeSendReply method.
http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.idispatchmessageinspector.beforesendreply.aspx
P.S Another great method is AfterReceiveRequest for all kind of message tweaking magic!