title | description | services | documentationcenter | author | manager | editor | ms.assetid | ms.service | ms.workload | ms.tgt_pltfrm | ms.devlang | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn to encode or decode flat files using the Enterprise Integration Pack in Azure Logic Apps| Microsoft Docs |
Use the features of Enterprise Integration Pack and Logic apps to encode or decode flat files |
logic-apps |
.net,nodejs,java |
msftman |
anneta |
82152dab-c7ad-43df-b721-596559703be8 |
logic-apps |
integration |
na |
na |
article |
07/08/2016 |
deonhe |
You may want to encode XML content before you send it to a business partner in a business-to-business (B2B) scenario. In a logic app, you can use the flat file encoding connector to do this. The logic app that you create can get its XML content from a variety of sources, including from an HTTP request trigger, from another application, or even from one of the many connectors. For more information about logic apps, see the logic apps documentation.
Follow these steps to add a flat file encoding connector to your logic app.
-
Create a logic app and link it to your integration account. This account contains the schema you will use to encode the XML data.
-
Add a Request - When an HTTP request is received trigger to your logic app.
-
Add the flat file encoding action, as follows:
a. Select the plus sign.
b. Select the Add an action link (appears after you have selected the plus sign).
c. In the search box, enter Flat to filter all the actions to the one that you want to use.
-
On the Flat File Encoding dialog box, select the Content text box.
-
Select the body tag as the content that you want to encode. The body tag will populate the content field.
-
Select the Schema Name list box, and choose the schema you want to use to encode the input content.
At this point, you are finished setting up your flat file encoding connector. In a real world application, you may want to store the encoded data in a line-of-business application, such as Salesforce. Or you can send that encoded data to a trading partner. You can easily add an action to send the output of the encoding action to Salesforce, or to your trading partner, by using any one of the other connectors provided.
You can now test your connector by making a request to the HTTP endpoint, and including the XML content in the body of the request.
Note
To complete these steps, you need to have a schema file already uploaded into you integration account.
-
Add a Request - When an HTTP request is received trigger to your logic app.
-
Add the flat file decoding action, as follows:
a. Select the plus sign.
b. Select the Add an action link (appears after you have selected the plus sign).
c. In the search box, enter Flat to filter all the actions to the one that you want to use.
-
Select the Content control. This produces a list of the content from earlier steps that you can use as the content to decode. Notice that the Body from the incoming HTTP request is available to be used as the content to decode. You can also enter the content to decode directly into the Content control.
-
Select the Body tag. Notice the body tag is now in the Content control.
-
Select the name of the schema that you want to use to decode the content. The following screenshot shows that OrderFile is the selected schema name. This schema name had been uploaded into the integration account previously.
At this point, you are finished setting up your flat file decoding connector. In a real world application, you may want to store the decoded data in a line-of-business application such as Salesforce. You can easily add an action to send the output of the decoding action to Salesforce.
You can now test your connector by making a request to the HTTP endpoint and including the XML content you want to decode in the body of the request.