WCF/GSoap interoperability RRS feed

  • Question

  • Hi,

    I am currently writing a self hosted WCF server that must interact with a
    gSOAP client. The client is using SOAP 1.2 (sort of), and I have created a
    custom binding so I can use SOAP 1.2 without WS-Addressing:

    <binding name="NonSecureBinding">
    <textMessageEncoding messageVersion="Soap12" />
    <httpTransport />

    I am constantly getting a SOAP fault saying:

    "The message with Action '' cannot be processed at the receiver, due to a
    ContractFilter mismatch at the EndpointDispatcher. This may be because of
    either a contract mismatch (mismatched Actions between sender and receiver)
    or a binding/security mismatch between the sender and the receiver. Check
    that sender and receiver have the same contract and the same binding
    (including security requirements, e.g. Message, Transport, None)."

    The cause of this is the gSOAP client is not setting the action in the
    Content-Type section of the header as specified in the SOAP1.2 standard
    (Content-Type: application/soap+xml; charset=utf-8;
    action="http://myserver/myaction"), instead it is putting it in the
    SOAPAction section ala SOAP 1.1 (SOAPAction: "http://myserver/myaction"), and
    leaving the expected action item null.

    Obviously there is an issue on the gSOAP side, however there is still an
    issue to resolve. The SOAP 1.2 specification explicitly says that a service
    "SHOULD NOT require (the action elements) presence in order to operate". So
    I wrote a quick and dirty client to see if the service would work without the
    action element being present (all else being equal), same issue.

    So in an attempt to resolve this I thought I would create a custom contract
    filter and just accept everything. What I did is basically have "Match"
    return true, which didn't change the result at all. However if, within my
    Match() method call I explicitly set the action to what it should have been
    it works as expected (so something after the call to my Match method is
    rejecting the request.

    Now for the question, how can I get a WCF service to not require the action
    element in the HTTP headers? I am at a loss.


    Tuesday, January 29, 2008 5:21 PM