2

I have a WCF host service I am working on which needs to be created to a specific standard. I am using a custom binding to achieve most of the requirements of the standard.

WS-Addressing headers are required in the response and request headers, and though some seemed to be configured automatically we were missing the "MessageID", "From" and "To" elements.

We added the "From" "To" and "ReplyTo" headers on our test client using message inspectors and the "BeforeSendRequest" method. This worked as expected.

On the host service we tried to use the same approach for "MessageID", "From" and "To" elements using the "BeforeSendReply" method. However only "MessageID" and "From" headers appear in the message. The "To" header does not get added.

Could anyone offer any suggestions of
1. How to include/add the "TO" ws-addressing header to the response message?
2. The reason WCF does not add the "To" header to the message using the message inspector method for responses?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199

1 Answers1

0

It basically comes down to setting your ManualAddressing property to true in order to inform the channel underlying to the service that he should no longer intervene with the To: header.

This can be done with a custombinding in your web.config:

<customBinding>
  <binding name="customBinding_manualAddressingEnabled">
    <textMessageEncoding />
    <httpTransport manualAddressing="true"/>
  </binding>
</customBinding>

Please see answer for more details.

Community
  • 1
  • 1
Steven De Bock
  • 429
  • 4
  • 21