0

I have an existing orchestration which calls the services with the below configuration.

System.Diagnostics.EventLog.WriteEntry("ABC", Message_Datasheets(FILE.ReceivedFileName));
varNewSearchDataLoadURL = System.Configuration.ConfigurationManager.AppSettings["NewSearchDataLoadURL"];
varNewXmlMsg = new System.Xml.XmlDocument(); 
varNewXmlMsg.LoadXml(@"<path>" + Message_Datasheets(FILE.ReceivedFileName) + @"</path>");
Message_NewUnZip = varNewXmlMsg;
Message_NewUnZip(HTTP.RequestTimeout) = 3600;
Port_NewJaxMiceSearch_API(Microsoft.XLANGs.BaseTypes.Address) = varNewSearchDataLoadURL + "?path=" + Message_Datasheets(FILE.ReceivedFileName);
Port_NewJaxMiceSearch_API(Microsoft.XLANGs.BaseTypes.TransportType) = "HTTP"

Here NewSearchDataLoadURL holds the address of the webservice that needs to be called in the config file.And the path holds the received file name.So the called URI will be "http://new.abc.org/AbcSearchWebApi/api/search/loaddatafeed?path=\share01\BizTalk\data\out\20150723"

Now I have to change that to the Restful services which uses WebHttp Adapter. I am trying to follow the here

but I dont understand the BtsVariablePropertyMapping because I dont have schema that has the value to be promoted. How can I approach this. enter image description here Any help will be greatly appreciated.

trx
  • 2,077
  • 9
  • 48
  • 97

2 Answers2

0

So your goal is to call a Rest WebService using a dynamic port, in order to do this you need to
1 - Specifiy your type of operation

 <BtsHttpUrlMapping>
  <Operation Name=’MyRestGET’ Method=’GET’ Url=’/XXXX/{EmpId}’ />
</BtsHttpUrlMapping>

2 - Create and Map your variables :
"BtsVariablePropertyMapping" is a powerful BizTalk technique that enables you to define a custom variable in your url and map it to any context property using its name and namespace So you must definitely have the property schema unless it's a BizTalk context property hence its schema is already present in BizTalk

3 - Init your dynamic port with the webservice url
In this step you assign your webservice url and transport type in your dynamic solicit response port

Microsoft.XLangs.BaseTypes.Adress = /XXXX/{EmpId}
Microsoft.XLangs.Basetypes.TransportType = "WCF-WebHTTP"

And you are good to go with this

mahieddine
  • 540
  • 4
  • 14
  • I dont understand about the BtsVariablePropertyMapping here I dont have any thing in the schema that needs to be promoted for URL. The URL I am giving is like, `Port_NewSearch_API(Microsoft.XLANGs.BaseTypes.Address) = varNewSearchDataLoadURL + "?path=" + Message_Datasheets(FILE.ReceivedFileName);` Here what do I promote. varNewSearchDataLoadURL holds "http://new.abc.org/AbcSearchWebApi/api/search/loaddatafeed in the webconfig file. Any help is greatly appreciated. – trx Jul 24 '15 at 11:46
  • I have added in my question. – trx Jul 24 '15 at 12:43
  • You have to create a property schema for the adapter to use. It will set the request message based on those properties. – Dan Field Jul 24 '15 at 12:58
  • @Dan Field can you please explain in detail. Do I create a schema with a field. Here how do I pass the value of the Received File name in to the Schema field.Also URL address going to have three things right varNewSearchDataLoadURL + "?path=" + Message_Datasheets(FILE.ReceivedFileName); – trx Jul 24 '15 at 13:03
  • I have created a other question http://stackoverflow.com/questions/31611433/calling-restful-services because I could not add the code I am trying now. – trx Jul 24 '15 at 13:11
  • @mahieddinecherif I am calling the rest service dynamically. so I dont see anything in the Send port created. – trx Jul 24 '15 at 16:22
  • check this https://masteringbiztalkserver.wordpress.com/2013/11/11/calling-restful-service-using-dynamic-send-ports-biztalk-2013/ this is the solution with all the details you need – mahieddine Jul 24 '15 at 18:16
0

The below code works, without using the BtsVariablePropertyMapping

System.Diagnostics.EventLog.WriteEntry("ABC",   Message_Datasheets(FILE.ReceivedFileName));
varNewSearchDataLoadURL = System.Configuration.ConfigurationManager.AppSettings["NewSearchDataLoadURL"];
varNewXmlMsg = new System.Xml.XmlDocument(); 
varNewXmlMsg.LoadXml(@"<path>" +     Message_Datasheets(FILE.ReceivedFileName) + @"</path>");
Message_NewUnZip = varNewXmlMsg;
Message_NewUnZip(WCF.HttpMethodAndUrl) = @"<BtsHttpUrlMapping><Operation Name = 'RESTGet' Method ='GET'/></BtsHttpUrlMapping>";
Port_NewSearch_API(Microsoft.XLANGs.BaseTypes.Address) = varNewSearchDataLoadURL + "?path=" +      Message_Datasheets(FILE.ReceivedFileName);
Port_NewSearch_API(Microsoft.XLANGs.BaseTypes.TransportType) = "WCF-WebHttp";
Message_NewUnZip(WCF.SuppressMessageBodyForHttpVerbs) = "GET";
trx
  • 2,077
  • 9
  • 48
  • 97