Dorana
Dorana

Reputation: 331

WCF service for gSOAP client

I have received a request to build a Service to handle trafic from a predesigned client.

The documentation stated the service is a SOAP service but I later found out the protocol used by the predesigned client is gSOAP using SOAP 1.2

The issue I get is that when assigning the Binding to basicHttpBinding the error I get i Action '' not supported, since the client does not send the SOAPAction header (as it is not used in SOAP 1.2) and if I set the binding of my WCF service with wsHttpBinfing I get the error

HTTP/1.1 415 
Cannot process the message because the content type 'text/xml; charset=utf-8' 
was not the expected type 'application/soap+xml; charset=utf-8'.

So basicly it seems he gSOAP client they use sends the SOAP structure of SOAP 1.2 but with the Content-Type of SOAP 1.1

My question in this is how do I get my WCF service to handle the requests from the client. (The client cannot be modified in any way)

I have tried setting up a customBinding

<customBinding>
    <binding name="myCustomBinding">
      <textMessageEncoding messageVersion="Soap12" />
      <httpTransport/>
    </binding>
</customBinding>

with various messageVersion values. But I have yet to find a combination that works.

Upvotes: 2

Views: 1810

Answers (1)

Dorana
Dorana

Reputation: 331

Solved by creating a custom Dispatcher to map calls based on the SOAPBody.

Solution found in a Microsoft WCF Samples.

Samples found at:

Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4

Exact example (based on the folder the samples are installed in is)

Extensibility\Interop\AdvancedDispatchByBody

Upvotes: 3

Related Questions