views:

212

answers:

4

I've a WCF client communicating with an unknown server implementation which I have no control over. This client works fine it just doesn't like, what appears to be, incorrectly formed SOAP Fault messages. The messages I receive look like:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">   
    <soap:Header>...</soap:Header>  
    <soap:Body>  
        <soap:Fault>  
            <soap:faultcode>soap:Client</soap:faultcode>  
            <soap:faultstring>...</soap:faultstring>  
            <soap:detail>...</soap:detail>  
        </soap:Fault>  
    </soap:Body>  
</soap:Envelope>  

I believe according to the soap schema the child elements shouldn't be qualified and ned to look like:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">   
    <soap:Header>...</soap:Header>  
    <soap:Body>  
        <soap:Fault>  
            <faultcode>soap:Client</faultcode>  
            <faultstring>...</faultstring>  
            <detail>...</detail>  
        </soap:Fault>  
    </soap:Body> 
</soap:Envelope>

Is there something that I can configure or override so that I can consume messages which arrive in the latter format so that I can consume the fault messages instead of xml exceptions?

A: 

It looks like the offending application is using a custom (and badly implemented) SOAP library. The following article might help (I haven't had to deal with this as of yet as I am in a pure .Net shop).

http://msdn.microsoft.com/en-us/library/ms733721.aspx

Bill
Maybe I've missed something but I believe this is all stuff I can do for the server and not the client. Correct me if I'm wrong but it appeared that could create an IErrorHandler implementation, but I believe this only applies to the server side.
Dave
+3  A: 
Dave
A: 

Very Nice work, Dave.

Josh
A: 

Note that the System.Web.Services.Protocols.SoapHttpClientProtocol class seems significantly more tolerant of malformed Fault responses than WCF.

This is sometimes referred to as ASMX services protocol. That may be an option to consider as well.

Howard Hoffman

Howard Hoffman