In a WCF Basic Http Adapter Messaging "ONLY" scenario we have a problem with "mapping" Receive Soap action with the Send Soap actions.
A simple and pratical workaround is to make one send port for each action and make a filter based on receive location and WCF.Action.
It's a mess, and in a heavy biztalk scenario with 100 services and each with 10 operations you would be drenched in send ports.
So custom pipelines to the rescue and the BtsActionMapping to the rescue.
<BtsActionMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Operation Name="SubmitMessage" Action="dk.xxxxx.integration.BizTalkWCFTest/OneWayContractTest/WriteMessageToEventlog" />
<Operation Name="SubmitMessage2" Action="dk.xxxxx.integration.BizTalkWCFTest/OneWayContractTest/DoStuffNOW" />
</BtsActionMapping>
Unfortunately the BtsActionMapping only resolves on the property BTS.Operation. Which derives from the Orchestration port name. Im trying to avoid orchestrations. The solution is quite simpel :
A custom pipeline compoent that grabs the WCFAdapter Action property and promotes it to BTS.Operation.
public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
{
//extract the WCF action value
Object oValue = inmsg.Context.Read("Action", "http://schemas.microsoft.com/BizTalk/2006/01/Adapters/WCF-properties");
if (oValue != null)
{
inmsg.Context.Promote("Operation", "http://schemas.microsoft.com/BizTalk/2003/system-properties",oValue);
}
return inmsg;
}
Lo and Behold, One Receive Port, One Send port, and one pipeline component to bind them all..(in darkness !!!)
Awesome !
Michael Høtoft
027b5d35-bc1c-4413-8efe-274ec1ddc661|0|.0
BizTalk Server
BizTalk 2010, BizTalk, Pipeline, WCF