locked
Rest service calling dynamically. RRS feed

  • Question

  • Hi All,


    https://masteringbiztalkserver.wordpress.com/2013/11/11/calling-restful-service-using-dynamic-send-ports-biztalk-2013/ 

    Followed above blog and tested sample successfully.

    My question is ,if i have 30 parameters to the input of the rest service.

    Do i need to promote all the 30 field's and assign to variables? 

    How to achieve this scenario.

    Thanks,

    Santosh.


    Load Balence

    Friday, December 2, 2016 2:32 AM

Answers

  • Hi Santosh,

    With GET operation, there is certainly a limitation here. The amount of information you can send back using a GET is restricted as URLs can only be 1024 characters.

    In practice a GET with too long or too complex a query string can be sent as a POST instead, with the complex/long data represented in the body of the request.

    Refer the sample: http://www.quicklearn.com/blog/2013/08/30/biztalk-server-2013-support-for-restful-services-part-35/

    Firstly, check if you are able to invoke the POST operation outside BizTalk using something like Fiddler

    You will need the schemas for the Post operation. And specify the HTTP verb as POST in the WCF-WebHttp adapter config.

    image

    Regarding the schemas for the POST oepration-

    1) If web API uses JSON payloads-

    If you are using BizTalk 2013 R2, you can use the JSON schema wizard to create the XML schemas from your sample JSON request/response -

    https://msdn.microsoft.com/en-us/library/dn789171.aspx

    http://www.quicklearn.com/blog/2014/08/21/json-schemas-in-biztalk-server-2013-r2/


    If you are using an earlier version of BizTalk server, you can first generate the XML format for your JSON sample messages using something like this - http://codebeautify.org/jsontoxml. Once you have the sample XML request/response messages, you can easily create schemas using the Generate Schemas Wizard in a BizTalk project in Visual Studio.

    2) If web API uses XML format messages-

    Just use the sample XML request/response messages from Fiddler and you can create the schemas using the Generate Schemas Wizard in a BizTalk project in Visual Studio.



    Rachit Sikroria (Microsoft Azure MVP)

    Friday, December 2, 2016 6:35 AM
    Moderator