Hi,
I've got a WCF client that needs to use a Java Web Service. I need a
soapaction header to appear with the tcp info of the request. I tried
creating a message inspector to add the header, but this doesn't seem
to do it, it just adds the soapaction as a "WebHeader" (see the
example below) but doesn't put it with the other TCP headers at the
TCP level. I did a TCP trace to verify this. How do I go about
adding soapaction for TCP?
Thanks!
<HttpRequest xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/
Management/MessageTrace">
<Method>POST</Method>
<QueryString></QueryString>
<WebHeaders>
<SOAPAction>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT</
SOAPAction>
</WebHeaders>
</HttpRequest>
Here is the TCP trace (with url and host changed)
POST theservice HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
Host: thehost
Content-Length: 7327
Expect: 100-continue
Connection: Keep-Alive
Here is code from the client message inspector
Public Function BeforeSendRequest(ByRef request As
System.ServiceModel.Channels.Message, _
ByVal channel As
System.ServiceModel.IClientChannel) _
As Object Implements
IClientMessageInspector.BeforeSendRequest
Dim httpRequestMessage As
System.ServiceModel.Channels.HttpRequestMessagePro perty = New
System.ServiceModel.Channels.HttpRequestMessagePro perty
httpRequestMessage.Headers.Add("SOAPAction", "http://
schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT")
request.Properties.Add(System.ServiceModel.Channel s.HttpRequestMessageProperty.Name,
httpRequestMessage)
Return Nothing
End Function