Remove Signature node from response

May 30 2018 5:26 AM
Hello,
 
I have a problem with the response of an external WebService.
I do not have access to this WebService, and it is not possible to change anything there.
I have a valid request mounted and I get an OK response from the server, but my WCF client does not understand the Signature of the response.
Ends with error (in Spanish): "System.Xml.XmlException: The final element 'Signature' was expected from the namespace 'http://www.w3.org/2000/09/xmldsig#'. Element was found ' dsig: Object 'namespace' http://www.w3.org/2000/09/xmldsig# "
WCF does not understand the "Object" element.
After a lot of reading and testing I mounted a class "CustomTextMessageEncoder" in which I delete all the Signature node of the response in the ReadMessage method.
But, something makes this class that just by using it, deviates the message, because the request that was previously good, now after using this class is wrong. The server returns the error "Could not parse stream".
I think the latter returns it because something changes in the attributes of the Body.
If I retouch in the WriteMessage method of CustomTextMessageEncoder and leave it as I think it has to be, the error returned by the server is "Signature Error" and the request is the same as the first one that had ok.
Anyone knows how to solve this? Am I focusing the problem well by removing the Signature node from the response? Or is there some way that WCF can correctly process the Object element that the server returns in the response?
I have been with this for many hours and I have not seen how to solve it ....
Any help or new idea is welcome