I am trying parse XML from invokeHTTP method that is returned in utf-16 encoding specified in the response. I have tried below but I am still cannot get past this error
select request.* from (EXEC model.invokeHttp(action => 'POST', endpoint => 'url' ,contentType => 'application/x-www-form-urlencoded;charset=utf-8',headers => jsonObject('application/x-www-form-urlencoded;charset=utf-8' as "Content-Type",'utf-8' as "Accept-Charset",jsonArray('gzip', 'deflate') as "Accept-Encoding",'bearer token' as "App-Authorization"),request => 'payload')) AS ws,
XMLTABLE(XMLNAMESPACES(DEFAULT 'url'),'/path' PASSING XMLPARSE(DOCUMENT TO_CHARS(ws.result,'utf-8') WELLFORMED) columns
Name string PATH 'FirstName'
) AS request
I have tried specifying the encoding in the VDB for the translator, still same
<translator name="rest" type="ws">
<property name="DefaultBinding" value="HTTP"/>
<property name="DefaultServiceMode" value="MESSAGE"/>
<property name="encoding" value="UTF-16"/>
</translator>
Response:
<?xml version="1.0" encoding="UTF-16" standalone="yes"?>