me

WCF BasicHttpBinding does not always mean W3C SOAP 1.1

Posted on 9/09/2010

I spent a couple hours tonight troubleshooting why a vendor's SOAP 1.1 service couldn't talk to WCF's BasicHttpBinding. In this case I was getting the exception:

Server returned an invalid SOAP Fault.

Inner Exception: XmlException: Message=End element 'Fault' from namespace 'http://schemas.xmlsoap.org/soap/envelope/' expected. Found element 'tla:billybob' from namespace 'http://schemas.xmlsoap.org/soap/envelope/'. Line 2, position 568.

Was the service sending .NET bad XML?  What’s the deal?  Well, the exception goes into more detail complaining about an unexpected element.

W3C says regarding SOAP 1.1. faults:

Other Fault subelements MAY be present, provided they are namespace-qualified.

Turns out it the service is just fine according to W3C since these extra fault elements were namespace-qualified. However, BasicHttpBinding is more restrictive than the SOAP spec.  Man, this is giving me a flashback of .NET being picky with date-parsing! The issue was that .NET only supports SOAP 1.1 in this binding if it's also WS-I BP 1.1 compliant:

R1000: When an ENVELOPE is a Fault, the soap:Fault element MUST NOT have element children other than faultcode, faultstring, faultactor and detail.

I calmly pointed out to said vendor that I thought it would be a good idea to update their SOAP endpoint to be a little more friendly with .NET. We’ll see!

 

No comments:

Post a Comment