Custom Connector SOAP to REST fails on ![CDATA

oddgeirh 1 Reputation point
2022-10-24T08:33:15.09+00:00

I have created a Logic Apps Custom Connector in azure, SOAP to REST using WSDL file. The custom connector connects using on-prem GW. When I use correct variables the Custom Connector returns : "
BadRequest. Http request failed: the content was not a valid JSON. Error while parsing JSON: 'After parsing a value an unexpected character was encountered"

Using a SOAP tool localy i see the payload like this:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<ExportDailyInterfaceResponse xmlns="http://<domain>/<service>">
<ExportDailyInterfaceResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Interface><![CDATA[<?xml version="1.0" encoding="utf-8"?>.....]]</Interface>

I guess the "![CDATA[" is the reason for the fault. The XML i want to process is inside the ![CDATA[.....]] section.

Using wrong parameters/variables gives me the expected error message, this indicates the communication works

Is there a way of setting up Custom Connector to get around this issue?

It is not possible to connect to the service using public services, it is a local service and using on-premises gateway from Azure is the only way to conncet to the SOAP service.

I have tried a lot of things without success. Thankful for any help on this issue.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,996 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yitzhak Khabinsky 25,731 Reputation points
    2022-10-24T16:04:03.897+00:00

    Hi @oddgeirh ,

    Your XML sample has what is called an XML declaration prolog.

    <?xml version="1.0" encoding="utf-8"?>  
    

    It shall be just at very beginning of XML.
    It cannot be anywhere in the middle.

    Or just remove it completely.