Question

I'm attempting to have BizTalk broker the communication to a WCF service that maps some of its data within the response message's header and not the body portion. After researching, the solution was to write the header data to the OutboundCustomHeaders message context property and then the BizTalk WCF adapter will inject it into the outgoing message. This worked perfectly until I enabled message level security using a certificate. In this case, the header still gets included within the response message but AFTER the message is encrypted. This causes the receiving client to throw a MessageSecurityException with the message 'required message part was not encrypted."

Is there a way to configure BizTalk to write the OutboundCustomHeaders before encryption occurs or another way to inject my header in the response?

I'm not sure how much it helps or complicates the answer, but the receive location in BizTalk is using the ws2007HttpRelayBinding to create an Azure endpoint for the client connections.

Was it helpful?

Solution

The solution for this problem was found by creating a custom behavior that adds the required header to the channel protection requirements and attaching it to the ws2007HttpRelayBinding.

I used the following link as a reference to my solution: WCF custom messages security

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top