Posts

Showing posts with the label BizTalk

Error: selected a node which is not valid for property or distinguished field retrieval, or it selected no node at all. Only text-only elements or attributes may be selected.

 Error:  selected a node which is not valid for property or distinguished field retrieval, or it selected no node at all. Only text-only elements or attributes may be selected. Root Cause: I was trying to assign a value to a node which was not present in the input XML Solution First create the node in a map and then try to assign a value to the node,

Visual studio 2019 crashing when trying to open a solution

Issue: I encountered a strange problem today. When I attempted to open a solution I had developed a few days ago in Visual Studio 2019, it kept crashing. Resolution: Repair Visual Studio. Restart the server or your development box.

Changes not refecting when deployed using CI CD pipeline in BizTalk

Issue In some cases when you deploy the changes using CI CD pipeline in BizTalk the changes might not be visible. Root cause CI CD might have skipped the undeploy. Hence you need to manually uninstall by going to the control panel and uninstalling it. Please go ahead and delete the .msi from the back up and the main folder as well

Message splitting using XML receive pipeline

Image
 Introduction In this blog, we will try to understand how we can split messages using an XML receive pipeline. Steps Create the schema for the split messages and also the envelope schema. Please follow the below steps Create a Racquet Schema in the project. Right Click on the Project --> Add --> New Item --> Schema Let us now create an envelope Schema named 'RacquetsEnvelope'. Right Click on the Project --> Add --> New Item --> Schema Name the root node 'Racquets' Click on Schema node , go to properties and set 'Envelope' to 'Yes'. Go to Imports --> Collections --> Add --> Add the 'Racquet' schema Click on 'Racquets' node and set Body Xpath to '/*[local-name()='Racquets' and namespace-uri()='http://POCSplitMessages.RacquetsEnvelope']' Right-click on the Racquets node and create a child record Click on the child record --> properties --> Data Structure type = ns0:Racquet (Reference) ...

Error handling using nested scopes used for API calls via BizTalk

Introduction Think about a scenario where you need to send a request to an API and capture error responses for HTTP status codes other than 200, as well as for HTTP status code 200. You can use the logic below to achieve this. Steps The main scope captures errors related to HTTP status codes other than 200, while the child scope captures errors for HTTP status code 200. In the child orchestration, we check a specific field in the response. If the field is not populated with a value, we know that there is an error and can handle it accordingly. Main Scope {     //Send API request to API     //Receive response     Child scope    {     //Check for a particular Business identifier in the response message.For example, check invoice ID is present in the response message     //Throw custom exception     }     Child Catch block    {     //Catch custom errors     //Log custom errors ...

Custom Exceptions in BizTalk

Image
Introduction Think about a scenario in which we receive a response from a stored procedure and if the response is an error, we need to abort the transaction with a custom error message and route it to the catch block. We can accomplish this using custom error handling in BizTalk. Steps: In the orchestration code block where you need to capture the custom error, place an expression shape.   Now insert the below line of code in the Expression shape: objException = new System . Exception ( insertStatus );   " ObjException " is a variable of type ' System.Exception' Below the expression shape, place a ' Throw Exception ' shape with an exception object of 'ObjException .' By doing this, we are throwing a custom exception, and the catch block will capture the custom errors and process them as configured in the catch block.

Creating a flat file Schema using Flat File Schema Wizard - Comma delimited flat file

Image
 Introduction In this blog post, we will try to understand how to create a flat file schema using a flat file schema wizard. Steps Let's use the flat file below to generate the schema. Invoice Number,Date,Customer Name,Customer Address,Item Description,Quantity,Unit Price,Total INV-2023-001,2023-09-23,John Doe,123 Main St,Product A,5,10.00,50.00 INV-2023-002,2023-09-24,Jane Smith,456 Elm St,Product B,3,15.00,45.00 INV-2023-003,2023-09-25,Bob Johnson,789 Oak St,Product C,2,20.00,40.00 Create a new BizTalk project and solution and name it POCFlatFileSchema Right Click on the project --> Add New Item Provide the instance file path, Name the record as "Invoice" and code page as shown below First we need to define the records and then elements within the record. The schema wizard will walk us through the process. Select the first record as shown below and click next Invoice Number,Date,Customer Name,Customer Address,Item Description,Quantity,Unit Price,Total¶« This is the c...

Start Orchestration in BizTalk

Image
Introduction In this blog, we will try to understand the basics of start orchestration in BizTalk. Sometimes, there's a need to trigger another orchestration for processing without expecting control to return to the parent orchestration. In such scenarios, opting for Start Orchestration is a viable solution. This approach allows us to implement separate error handling within the child orchestration. The parent orchestration continues its execution without waiting for control to return, advancing through the remaining steps in the business process. Scenario Source A message is received by Process A orchestration which is the parent or the main orchestration It then does a transformation and then Starts the Process B orchestration. Process B orchestration sends out the message to another system. Error handling is done for the send operation High Level Steps Receive SourceA File in ProcessA orch Define message variables msgSourceA of type SourceA schema and msgSourceB of type Source B...

Basics of Correlation in BizTalk

Image
 Introduction In this blog, we will try to understand the basics of Correlation. In some cases, we would want the message to be correlated to another message in the message box and we can use correlation set and correlation Type to achieve this. Sometimes, it's not just about connecting messages. We may also need to attach additional properties to a message, such as a unique GUID or an application identifier, and promote these properties on to the context. We can also achieve this using Correlation Type and correlation set. Think of Correlation Type as a class, and Correlation Set as an instance of that Class.  Process Flow Schema Creation Create an Order schema with a field called Order. Distinguish this field Create an Ack Schema with a field called Status Create a Property Schema with 4 fields and set the property base of the fields to "MessageContextPropertyBase": Application Order Application1 Order1 Maps Create a map and name it "Order_TO_Ack". Source Sche...