Page 1 of 1

NuSoap (or PEAR) return straight xml, < > strip &g

Posted: Fri Nov 28, 2003 11:58 am
by warf
For the past week I have been trying to return straight xml to an oracle portal server. I have concluded that the problems lays in the soap server stripping the xml tags < > from the soap value (as seen by the response packet in the soapVal section).

The xml is sent in a string that is perfect xml until it is transferred through the NuSoap server (same response with PEAR).

I have tested this many times, the xml is absolutely fine until it touches the soap server. I have even tried removing the lines from the soap server that change the < > to html special chars > and it simply causes a soap error.

Code: Select all

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

<SOAP-ENV:Envelope  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:ns4="urn:Server"
 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>

<ns4:lookupResponse>
<return xsi:type="xsd:string"><?xml version="1.0"?>
<root>
  <tblSchedule>
    <cdts>13579</cdts>

    <wbs>1</wbs>
    <taskname>Milestone A</taskname>
    <duration>150</duration>
    <startdate>2003-01-01</startdate>

    <finishdate>2003-07-29</finishdate>
    <percentcomplete>1</percentcomplete>
  </tblSchedule>
  <tblSchedule>
    <cdts>13579</cdts>

    <wbs>2</wbs>
    <taskname>Milestone B</taskname>
    <duration>180</duration>
    <startdate>2003-07-30</startdate>

    <finishdate>2004-04-06</finishdate>
    <percentcomplete>0.2</percentcomplete>
  </tblSchedule>
  <tblSchedule>
    <cdts>13579</cdts>

    <wbs>3</wbs>
    <taskname>Milestone C</taskname>
    <duration>200</duration>
    <startdate>2004-04-07</startdate>

    <finishdate>2005-01-11</finishdate>
    <percentcomplete>0</percentcomplete>
  </tblSchedule>
  <tblSchedule>
    <cdts>13579</cdts>

    <wbs>4</wbs>
    <taskname>LRIP</taskname>
    <duration>130</duration>
    <startdate>2005-01-12</startdate>

    <finishdate>2005-07-12</finishdate>
    <percentcomplete>0</percentcomplete>
  </tblSchedule>
</root>
</return></ns4:lookupResponse>
</SOAP-ENV:Body>

</SOAP-ENV:Envelope>
All I need to do is make the < and > translated values back to < and > respectively. Any thoughts or suggestions are most welcomed.

Posted: Fri Nov 28, 2003 1:45 pm
by mrvanjohnson
All I need to do is make the < and > translated values back to < and > respectively
Well you could always drop the results into a variable the do a [php_man]str_replace [/php_man]to fix your problem.

Also you can do something fancy like [php_man]get_html_translation_table[/php_man] with a [php_man]array_flip[/php_man] which should also fix your problem..

Posted: Fri Nov 28, 2003 2:00 pm
by warf
the problem with the str_replace is that the soap server just overrides it or errors out .