Page 1 of 1

Problem of format after POST to a webservice

Posted: Tue Jun 05, 2012 3:05 pm
by bangkok
I send successfully a query to a webservice with a POST command.

Here are the raw data sent back by the webservice :

Code: Select all

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Tue, 05 Jun 2012 13:40:26 GMT

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" [.... SOAP stuff]

<resultXml xsi:type="xsd:string"><?xml version="1.0" encoding="UTF-8"?><RESULT><GRP ID="G1"><FLD NAME="SOHNUM" TYPE="Char">NOR1203END00058</FLD></GRP><GRP ID="G2"><FLD NAME="SOHTYP" TYPE="Char">NOR</FLD><FLD NAME="SALFCY" TYPE="Char">END</FLD><FLD NAME  [. etc ...]
althought they are ok in the SOAP header..
" are not displayed as "
> are not displayed as >
.... in the <resultXml xsi:type="xsd:string">

Furthemore, i receive strings with accentued characters (like "référence transformed in r&#xE9;f&#xE9;rence )

I've tried :
set the htmltext... no effect
the unidecode.... no effect

If i open such a file with Firefox or Internet Explorer, everything looks fine. Any idea ?

Re: Problem of format after POST to a webservice

Posted: Tue Jun 05, 2012 4:39 pm
by shaosean
Check out the URLDecode function..

Re: Problem of format after POST to a webservice

Posted: Tue Jun 05, 2012 7:11 pm
by bangkok
shaosean wrote:Check out the URLDecode function..
I did.

But

Code: Select all

put urldecode("TYPE="Char">")
doesn't change the string.

Re: Problem of format after POST to a webservice

Posted: Tue Jun 05, 2012 7:38 pm
by mwieder
No, sorry, urldecode() doesn't change the "&xxx;" forms - it translates the "%NN" forms and changes "+" to spaces. Yo have to handler the "&" forms yourself with replace commands.

...or take the easy way out using an intermediate field to do the conversion:

set the htmlText of field "fldOutput" to tInputStream
put field "fldOutput" into tConvertedStream