question

MadhuraBhangay-0985 avatar image
0 Votes"
MadhuraBhangay-0985 asked MayankBargali-MSFT edited

Encoding and decoding of request in Logic APP

Hello All,
We are using Logic APP to process our XML request. This request is being sent to logic APP via API management. API management is sending a XML file but when we receive it in Logic APP its encoded. And while sending the request from Logic APP to function app this request is being decoded implicitly by logic APP.

The issue is this implicit conversion of XML is adding unknown locale characters ('REPLACEMENT CHARACTER' (U+FFFD)) in the decoded XML.

Why logic APP is adding these unknown characters while decoding?
Can we disabled this implicit encoding and decoding in logic APP?

Thanks In advance.

azure-logic-apps
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MadhuraBhangay-0985 Thanks for reaching out. Can you share more details on which action you are using in the logic app that is causing the issue? It will be great if you can provide screenshots of one of your runs where you observed that the request was changed by logic app action. Ideally, there should be no data changed, until and unless you are using some action that would make it explicitly changed.

0 Votes 0 ·

Thanks for the response.
Request flow is:
Client --> Api Management --> Logic APP --> Function APP

I am getting XML as an input to HTTP triggered logic APP. Client is sending XML request but when we receive at Logic APP side in some cases is encoded. Then we are sending the body of this request to a function app.

If I print the request body in function app, it is in XML format and shows that it has added unknown characters. This is happening when I send the request from my application. But when I tried to send same request from a REST client, logic app is encoding and decoding the request properly.
I tried to compare headers of the two requests but couldn't find much difference. Can you please guide me what all headers should I check to get proper encoding and decoding in logic app?

Thanks in advance.188668-logicappinput.png188771-functionappcall.png


0 Votes 0 ·
logicappinput.png (20.5 KiB)
functionappcall.png (20.4 KiB)

1 Answer

MayankBargali-MSFT avatar image
1 Vote"
MayankBargali-MSFT answered MayankBargali-MSFT edited

Posting as an Answer due to character limits

@MadhuraBhangay-0985 Thanks for your response. I don't see the same behavior at my end when I use the HTTP trigger and then create an HTTP request from the logic app. Whatever data I am passing to my HTTP request the same is passed to my function app until and unless the data is passed to my HTTP trigger is invalid or incorrect.

Have you verified if the data (XML content) is correctly sent from your client? How you can confirm that the data is only changed at the logic app end? The issue can be in any of the systems and you need to validate exactly where the XML data is getting changed.
- At the APIM end if there is no logging of the input XML then leverage the Trace to dump the input XML from your client.
- Add more traces to validate if there is any policy that may be changing your client input request.

Once you have the log with the sample input XML you can easily validate if the client has sent incorrect data or not (This will eliminate client-side issue as your client is sending the right data)
In case if it is correct data then use the same data to create the request and enable the OCP-APIM-trace to validate if any policy is changing the input data before sending it to the logic app. (This will eliminate APIM issue as the traces will confirm if the data was forwarded correctly or not)

Please refer to my private comment so I can connect with you offline to assist you further.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.