I have a problem with message parsing on WCF service.
I ran server-side of WCF application. Another company sends me such HTTP POST request:
POST /telemetry/telemetryWebService HTTP/1.1
Host: 192.168.0.160:12123
Content-Length: 15870
Expect: 100-continue
Connection: Keep-Alive
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security> ... </wsse:Security>
</soapenv:Header>
<soapenv:Body>
...
</soapenv:Body>
</soapenv:Envelope>
How you can see this in this HTTP request missing 2 important headers: Soap Action and Content-type.That’s why my service cannot process this request correctly.
I need to catch the request until it starts to be processed and manually add these headers.
I’ve already tried IDispatchMessageInspector, but whithout any result.
Thank you all.
1) You need to create you own custom message encoder, where you can create the Content-type by default. Yщu can read it here with examples.
2) You need to create custom message filter because you need to skip messages without SoapAction
3) You need to create custom message selector for assigning incoming messages to operations. Cybermaxs‘s example is very good.