Posts

Showing posts with the label BizTalk JSON

Creating JSON schema using JSON schema wizard in BizTalk

Image
 Introduction Let us try to create a JSON schema in BizTalk using the sample JSON invoice given below. {     "invoiceNumber" : "INV2023-001" ,     "date" : "2023-10-01" ,     "dueDate" : "2023-10-15" ,     "customer" : {         "name" : "ABC Company" ,         "address" : "123 Main Street" ,         "city" : "Anytown" ,         "postalCode" : "12345" ,         "country" : "USA"     },     "items" : [         {             "description" : "Product A" ,             "quantity" : 5 ,             "unitPrice" : 10.99 ,             "total" : 54.95         },         {             "description" : "Product B" ,     ...

REST API Calls with Query Parameters in BizTalk: A Step-by-Step Guide

Image
 Introduction In this blog, I will provide a comprehensive guide on how to call a REST API that requires query parameters. We'll walk through the necessary steps to set up the environment and make successful API calls. Solution High Level Steps 1. API Overview: We will be using an open API for demonstration purposes. The API endpoint we'll be working with is: https://randomuser.me/api/?results=1 2. Schema Creation: Create a schema named "SourceA" that matches the structure of the messages you'll be dropping in the receive location. To create a JSON response schema, follow these steps: capture the JSON response by running a test in Postman, and then utilize a JSON schema generator to create the desired JSON schema. 3. Field Promotion: In the SourceA schema, promote the field called "results." This field will serve as the variable for the query parameter. 4. Receive JSON Pipeline: Develop a receive JSON pipeline that can receive JSON messages and convert t...

Error: There was a failure executing the send pipeline: "abc" Source: "JSON encoder" Send Port: "xyz" URI: "" Reason: Input string was not in a correct format.

 Error: There was a failure executing the send pipeline: "abc" Source: "JSON encoder" Send Port: "xyz" URI: "" Reason: Input string was not in a correct format. Issue: While attempting to make a POST API call through an orchestration, I encountered the following error: There was a failure executing the send pipeline: "abc" Source: "JSON encoder" Send Port: "xyz" URI: "" Reason: Input string was not in a correct format. Root Cause:  The error occurred due to an issue with the input payload. The field's data type was specified as xs:unsignedShort, but I mistakenly provided the input value "DC_NUMBER," which is an incorrect format. However, after correcting the input value to a numerical format like "00015925," the issue was resolved successfully.