Fix problematic server response in WCF

I am using WCF as client for java web service. I have no control over the server side.

There is no xmlns attribute for the first element inside the soap headers in the response I get from the web service. Because of this, WCF returns null as a result of calling the web service.

Apart from the missing xmlns, the answer is fine and if I add the xmlns using a script then everything works as expected. I don't know enough about SOAP to know if the xmlns attribute is really needed.

Is there a way to avoid this problem, or force WCF to ignore the missing xmlns attribute, or even a hook that would allow me to manually redirect the response before it hits WCF?

0


source to share


1 answer


This seems to be a pretty old question, so I'm not sure if you have addressed this. If you are working with a WCF client for Java Axis service, you will find that you have to get used to using MessageInspectors to override the request and response behavior.

Using the AfterReceiveReply method, you can copy the original message and change the headers. Also check Step 5 from this MSDN article .



You cannot change the response headers directly in this method as far as I can see because they are read-only, so copying and replacing the response with a modified version is the only way I can fix the missing namespace.

+2


source







All Articles