How to Set URL and Authorization Token in BizTalk Dynamic REST Post

Here are some samples that might be useful if you need to dynamically send a REST “POST” message.

Of course, in the real world, the token and the URL would probably be some type of configuration variable.

YourMsgRequestName(WCF.HttpHeaders) =
        "Accept: application/json" +
        "\r\n" + 
        "Content-Type: application/json " +
        "\r\n" + 
        "X-AUTH-TOKEN: yourSecretAuthTokenHere" ;

// Add additional parts to the base URL Address 
YourMsgRequestName(WCF.HttpMethodAndUrl) = 
   "<BtsHttpUrlMapping>" + 
   "   <Operation Name='Post' Method='POST' Url='/messages/email' />" + 


YourMsgRequestName(BTS.RetryCount) = 0;
YourMsgRequestName(WCF.OpenTimeout)  = "00:01:00";
YourMsgRequestName(WCF.CloseTimeout) = "00:01:00";
YourMsgRequestName(WCF.SendTimeout)  = "00:01:00";

// how to override Dynamic Pipeline Configuration Values: 

// This sets the root name and namespace in the Receive Pipeline (in the two way SendPort) 
// ( 
// Instead of doing this, we can put these values in our custom pipeline directly. 
VarRootName = "SendEmailResp"; 
VarNamespace = "http://YourProject.Schema.Response";
SendMailReq(BTS.SendPipelineResponseConfig) = 
  "<Root xmlns:xsd='' xmlns:xsi=''><Stages><Stage CategoryId='9d0e4103-4cce-4536-83fa-4a5040674ad6'><Components><Component Name='Microsoft.BizTalk.Component.JsonDecoder'><Properties><RootNode vt='8'>" + 
   VarRootName + 
   "</RootNode><RootNodeNamespace vt='8'>" +
   VarNamespace + 

DynPortName(Microsoft.XLANGs.BaseTypes.Address) = ""; 
DynPortName(Microsoft.XLANGs.BaseTypes.TransportType) = "WCF-WebHttp"; 

Leave a Reply

Recent Posts




All Rights Reserved Theme by 404 THEME.