I am adding a custom soap header on the client. But when the message reaches
the service, the soap envelope does not contain the header I added. Am I
doing something wrong?
The envelope at the client looks like this:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header CALLBACK="true"/>
<soap:Body>
<string xmlns="http://tempuri.org/">afffda</string>
</soap:Body>
</soap:Envelope>
And the envelope that reached the service is this:
<soap:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<string xmlns="http://tempuri.org/">afffda</string>
</soap:Body>
</soap:Envelope>
This is the code on the client side. The RepositorySoapSender extends the
SoapClient.
//Code
RepositorySoapSender client =
new RepositorySoapSender(new
Uri("soap.tcp://kishorch018144:5050/receiver"));
SoapEnvelope request = new SoapEnvelope();
request.SetBodyObject(this.textBoxID.Text);
request.CreateHeader();
request.Header.SetAttribute("CALLBACK", "true");
request.Context.Addressing.ReplyTo = new Uri(RepositorySoapReceiver.URI);
client.ProcessAsync(request);
Kishore Raghavan - 05 Nov 2004 04:07 GMT
This problem is fixed. WSE 2.0 SP1 removes the SoapHeader if it does find
any child element. I dont know why Microsoft did this.
-Kishore
>I am adding a custom soap header on the client. But when the message
>reaches the service, the soap envelope does not contain the header I added.
[quoted text clipped - 31 lines]
> request.Context.Addressing.ReplyTo = new Uri(RepositorySoapReceiver.URI);
> client.ProcessAsync(request);