Invoking ReSTful Web Services with BizTalk Server 2010

This sample demonstrates how to consume ReSTful services from BizTalk Server 2010.

C# (56.1 KB)
 
 
 
 
 
4.1 Star
(11)
2,443 times
Add to favorites
3/16/2011
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • I want to recieve the messages from Restful service into biztalk.
    1 Posts | Last post February 07, 2013
    • for one of the requirements I want to recieve the messages from Restful service into biztalk. Is there any word of advice on this.?Is there any sample application i can refer?
  • Not able to invoke the Resful API from Biztalk
    1 Posts | Last post September 07, 2012
    • I was tring to built a simlar stuff for another restful API.
      I have built an API based on the sample API shown here.
      http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api .
      after hosting the API i tried browsing as 
      http://localhost/WebApiPOC/api/products/1 and it returns valid result.Now i want to call this from biztalk .I created  an schema as simlar to shown as HttpRequest and built an orchestration to invoke the restful sevcice.I configured the end uri for reqresp port as http://localhost/WebApiPOC and did the other settings as well along with selecting the endpoint behaviour as biztalkWebHttp. i am placing the below message at the folder location .
      <ns0:BiztalkWebHttpRequest method="GET" uriTemplate="/api/products/{id}" xmlns:ns0="http://InvokeWebApiPOC.WebApiRequest">
        <param name="id">1</param>
        <header name="Content-Type">application/xml; charset=utf-8</header>
      </ns0:BiztalkWebHttpRequest>
      But I end up in getting the argument exception while sending the http request to the API. See below error msg. 
      "A message sent to adapter "WCF-Custom" on send port "SndRcvPort_SndRcvWebApiREqRespMsg" with URI "http://localhost/WebApiPOC" is suspended. 
       Error details: System.ArgumentNullException: Value cannot be null.
      Although i am trying to append the URI in the message inspector class but that is not reflecting in the error.
      I suspect the endpoint behaviour is not working for me.Is there any way to debug the endpoing behaviour. I tried writing into eventlog from Message inspector class in the BeforeSendRequest method  but that also not appearing in the event log.   
      I have added the message inspector d.. in the gac.
      Any idea if i am missing something ????
  • Using XML as a Parm
    2 Posts | Last post December 11, 2011
    • I am using, and loving, the sample you created but I am having an issue. I need to call a service that uses XML as a parameter in the query string example: 
      
      http://www.oanda.com/cgi-bin/fxml/fxml?fxmlrequest=<convert><client_id>myclientid</client_id><expr></expr><exch>USD</exch></convert>
      
      
      I am sending the following message:
      
      <?xml version="1.0" encoding="utf-8"?>
      <bizTalkWebHttpRequest
        xmlns="http://company.com/schemas/biztalkwebhttp/1.0"
        method="GET"
        uriTemplate="/fxml?fxmlrequest={FXMLRequest}">
        <param name="FXMLRequest"><convert><client_id>myclientid</client_id><expr></expr><exch>USD</exch></convert></<param>
        <header name="Content-Type">application/xml; charset=utf-8</header>  
      </bizTalkWebHttpRequest>
      
      I end up with:
      
      "http://www.oanda.com:80/cgi-bin/fxml/fxml?fxmlrequest=myclientidUSD"
      
      It appears that the behavior ignores all xml tags in the message as characters in the parameter and reads only the values contained in the tags. Do I need to build the xml string in side the behavior? 
    • You could ask this question also through BizTalk Forums: http://social.msdn.microsoft.com/Forums/pl-PL/category/biztalkserver
  • Why Biztalk hangs on bulk message processing
    1 Posts | Last post July 26, 2011
    • Hi my biztalk application often hangs when bulk datas are processed when i restart the server the problem is solved,Why its happening what may be the root cause for the problem