Morpheus273
Morpheus273

Reputation: 47

Can't read REST API with an XML response using Synapse Pipeline's Copy Activity

Trying to read REST API endpoints through Synapse pipeline and sinking it in a JSON format. The API response is XML and the run ends up erroring out.

--------Error--------- { "errorCode": "2200", "message": "Failure happened on 'Source' side. ErrorCode=JsonInvalidDataFormat,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Error occurred when deserializing source JSON file ''. Check if the data is in valid JSON object format.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=Newtonsoft.Json.JsonReaderException,Message=Unexpected character encountered while parsing value: <. Path '', line 0, position 0.,Source=Newtonsoft.Json,'", "failureType": "UserError", "target": "Copy REST API Data", "details": [] } --------Error---------

Do not want to go back and use existing C# script-based code which is currently run through SSIS packages.

Any assistance will be appreciated.

Upvotes: 0

Views: 494

Answers (1)

Aswin
Aswin

Reputation: 7156

I tried to repro this using Rest connector in ADF and got the same error. Rest connector supports only JSON file. Refer this Microsoft Document on Supported capabilities of REST connector.

enter image description here

Instead use HTTP connector and select XML dataset. Below is the approach to do it.

  • Select HTTP in linked service. enter image description here

  • Enter Base URL and authentication type and then click create. enter image description here

  • Create new dataset for HTTP linked service. Select HTTP and then continue.

enter image description here

  • Select XML format and then select continue. enter image description here

  • Give the linked service and relative url and then click OK. enter image description here

  • Use this dataset as source dataset in copy activity. Once pipeline is run, data will be copied to sink.

Upvotes: 0

Related Questions