Calling RestFul Services

自作多情 提交于 2019-12-11 10:59:21

问题


I am trying to call the RestFull Services from BizTalk 2013 R2. I am trying to change the existing one using Http adapter and use Wcf-WebHttp Adapter

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";

I am not sure if this is the correct way to do it. Can I call without using the BtsVariablePropertyMapping without creating a schema and promoting it?


回答1:


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";


来源:https://stackoverflow.com/questions/31611433/calling-restful-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!