question

RamakrishnaTumati-3735 avatar image
0 Votes"
RamakrishnaTumati-3735 asked SathyamoorthyVijayakumar-MSFT edited

Can we pass XML payload to rest connector in Azure Data Factory? or How to pass XML payload to rest connector in Azure Data Factory

Hi,

I am trying to get data from Rest API service, it uses payload in XML format. So, when using Azure Data Factory I am trying to pass this payload as request body.

But getting this error "Error occurred when deserializing source JSON file ''. Check if the data is in valid JSON object format. Unexpected character encountered while parsing value: <. Path '', line 0, position 0."

So, I want to check if XML can be passed as request body? or Is there any other way to solve this?

Any information regarding this issue will be very helpful.

Thank you
Ramakrishna Tumati

azure-data-factorypartner-center-api
· 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.

Hello @RamakrishnaTumati-3735,

Thank you for your question.

Can you please let me know what activity you are making use of? Are you passing the Request Body - as a Dynamic Content?

Also - Did you happen to try the behavior HTTP Connector which is more generic to connect to the HTTP Endpoints.

135141-image.png


0 Votes 0 ·
image.png (12.9 KiB)
RamakrishnaTumati-3735 avatar image RamakrishnaTumati-3735 SathyamoorthyVijayakumar-MSFT ·

Hi @SathyamoorthyVijayakumar-MSFT ,

I am using REST connector in Azure Data Factory. No I am not passing request body as a dynamic content.

Here is a sample of what i want to pass as a request body

<requestname' UserId='XXX' SubOperationName='SmartQueryRequest' ><InputType>Input1</InputType><InputData><InputDataItem type='input1'>value1</InputDataItem><OptionalInputDataItem type='input2'>value2</OptionalInputDataItem></InputData><Output>col1, col2, col3, col4, col5</Output></requestname>

0 Votes 0 ·

1 Answer

SathyamoorthyVijayakumar-MSFT avatar image
0 Votes"
SathyamoorthyVijayakumar-MSFT answered SathyamoorthyVijayakumar-MSFT edited

Hello @RamakrishnaTumati-3735,

When I passed the XML in request body Payload, and I was not encountering the issue. However, you could check the format of the response body.

If the response body is XML, you re likely to encounter this issue as the REST connector supports only JSON body for the response body.

135501-image.png

If this your case - the workaround would be to make use of the HTTP as a source

135620-httpconnector.gif

Hope this will help. Please let us know if any further queries.


  • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how

  • Want a reminder to come back and check responses? Here is how to subscribe to a notification

  • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators


[2]: /answers/storage/attachments/135468-httpconnector.gif


image.png (21.5 KiB)
httpconnector.gif (185.6 KiB)
· 1
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.

Hello @RamakrishnaTumati-3735,

Following up to see whether the above suggestion was helpful.

0 Votes 0 ·