Logic Apps – XML Validation / Transformation

In the  current blog post we would be perform some validation and transformation for the incoming XML.

Before we start working with Logic Apps I have created a Schema and corresponding map transformation using Visual Studio and saved it on a local drive.

  • CustomerInfo.xsd
  • CustomerMap.xslt

xmlxsd

xslt.JPG

Login to the Azure portal and create an Integration Account. Here we will be uploading the schema and transformation created in our previous step.

integrationaccount

One the Integration account is in place you will see the account as below. Here we will be uploading our schema and map files.

integrationaccount2

integrationaccount1

integrationaccount3

Now once the schema and maps are in place, next step is to used them in our Logic Apps. Create a Logic App and in the designer view select Request / Response template.

LogicApp.png

LogicApp2.png

Save the Logic App for now. In order to access schema and map created above we need to link our integration account with the Logic App. Navigate to your Log App Workflow settings and link the integration account.

LogicApp3.png

Now you should be able to access your schema and map in your Logic App. Navigate to your logic app designer view and add the below 2 actions.

  • XML Validation
  • Transform XML

In you 1st Step when and HTTP request is received, keep the request body Json schema as empty.

LogicApp4.png

IN you XML validation select the CustomerInfo schema from the drop down and CustomerMap accordingly.

The output will be nothing but a Transformed XML. Save your Logic app and now lets test the scenario using a Postman.

LogicApp5.png

TESTING 

Copy the URL from the 1st step of your Logic App and post a request to your Logic App. The body will contain the instance of your schema. You must receive an output which is nothing but a transformed XML ( Concatenation of First Name and Last Name ).

You can always check the STATUS of your logic app from the overview tab.

LogicAppTest.png

 

 

 

 

 

 

 

Advertisements

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s