Question

I currently need to configure a dynamic send port to connect with an ASMX web service that does not conform to WS-I Basic Profile v1.1. Specifically, R9981, which states "An ENVELOPE MUST have exactly zero or one child elements of the soap:Body element." The web service I'm consuming is expecting a body with multiple elements, causing the SOAP body to look like:

<Body>
    <FirstElement />
    <SecondElement />
</Body>

I have tried using both WCF-BasicHttp and WCF-Custom adapters with no success. It seems that the BizTalk WCF adapters can just not handle a SOAP body with more than one element.

On the receive location, I wrap the message under one element using a template to solve the issue of the message traveling through BizTalk and I thought I could simple intercept the message with a custom send pipeline / custom component to strip out the wrapping element. I then tried a custom behavior extension with a message inspector, but that still occurs before BizTalk's WCF "BizTalkBodyWriter" does its work.

As I'm using the ESB 2.1 toolkit, I cannot use the HTTP adapter to create my SOAP message from scratch. My last thought would be I would need to create a custom WCF LOB adapter, but before I go down that route I want to make sure I'm not overcomplicating things here and there isn't an easy way I've just overlooked.

Was it helpful?

Solution

The solution was to create a custom message encoder. I followed WCF Interoperability and Extensibility - Part One as a guide.

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