While going from PHP 5.2.5 to PHP 5.2.6, nusoap appears to be removing special characters like left and right angle brackets and quotes from the response document (see nusoap debug info below). Does anyone know why nusoap is removing HTML special characters and what can be done to turn this feature off?
In advance, thanks.
2008-09-22 15:58:29.569114 soapclient: Got response encoding: ISO-8859-1
2008-09-22 15:58:29.569289 soapclient: Use encoding: ISO-8859-1 when creating nusoap_parser
2008-09-22 15:58:29.569471 nusoap_parser: Charset from HTTP Content-Type matches encoding from XML declaration
2008-09-22 15:58:29.569545 nusoap_parser: Entering nusoap_parser(), length=4095, encoding=ISO-8859-1
2008-09-22 15:58:29.570154 nusoap_parser: found root struct NDFDgenResponse, pos 2
2008-09-22 15:58:29.571498 nusoap_parser: in buildVal() for NDFDgenResponse(pos 2) of type struct
2008-09-22 15:58:29.571572 nusoap_parser: in buildVal, there are children
2008-09-22 15:58:29.571651 nusoap_parser: in buildVal, adding Java Vector or generic compound type NDFDgenResponse
2008-09-22 15:58:29.571736 nusoap_parser: in buildVal, return:
&string(2627) "?xml version=1.0?
dwml version=1.0 xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:noNamespaceSchemaLocation=http://www.nws.noaa.gov/forecasts/xml/DWMLgen/schema/DWML.xsd
product srsName=WGS 1984 concise-name=time-series operational-mode=official
titleNOAAs National Weather Service Forecast Data/title
production-centerMeteorological Development Laboratorysub-centerProduct Generation Branch/sub-center/production-center
point latitude=38.99 longitude=-77.01/
time-layout time-coordinate=local summarization=none
temperature type=maximum units=Fahrenheit time-layout=k-p24h-n7-1
nameDaily Maximum Temperature/name
2008-09-22 15:58:29.571887 nusoap_parser: parsed successfully, found root struct: 2 of name NDFDgenResponse
I'm having the same issue. Just appeared recently. As far as I can tell it's a problem with libxml2 (2.6.32) which I updated on Sept 10th to . You can see the problem with this PHP code. I'm using libxml2 (2.6.32) and PHP 5.2.6.
$xml_parser = xml_parser_create();
xml_parse_into_struct($xml_parser, "<SUMMARY>This is a link to <a
echo "Vals array\n";
 => Array
[tag] => SUMMARY
[type] => complete
[level] => 1
[value] => This is a link to a
Notice the <>'s missing for 'value'.
We are having the same problem would like to see a solution to this soon
I'm seeing the same behaviour, but I don't agree that it's caused by PHP 5.2.6.
I have a local installation that was running 5.2.5 on Apache/Windows. The local install was working correctly.
I have a remote installation that is running 5.2.6 on Apache/CentOS. The remote install was removing special chars.
At this point the behaviour was identical to that described above.
However, I updated my local installation to 5.2.6, and it continues to work correctly.
So now I have a local Apache/Win 5.2.6 installation that works correctly, and a remote Apache/CentOS 5.2.6 installation that does not.
The Apache versions are quite different (local is 2.2.10 and remote is 1.3.41) so there's a possibility that the old version of Apache is causing the problem.
And of course there is the fact that one environment is Windows based and the other is Linux based.
Hope this points someone in the right direction - so far we've been unable to resolve this issue, and it's holding up a rollout to our production environment.
I have found a reason for this problem, and a (not pretty) workaround.
This problem is being caused by problem with libxml2 (see this bug: http://bugs.php.net/bug.php?id=45996 ).
Apparently, if you're running libxml2 with a version later than 2.6.32 you'll see this behaviour.
This makes sense, as my local install is running 2.6.32 which works fine, while my remote install is running 2.7.2 and is broken.
There are two possible workarounds:
- Build PHP with a version of libxml2 <= 2.6.32
- Build PHP using libexpat
So, if you're running a 'bad' version of libxml2 the only known workarounds currently involve rebuilding PHP.
just put following 3 lines
$xml =str_replace(”<”,”<”,$xml );
$xml =str_replace(”>”,”>”,$xml );
$xml =str_replace(”&”,”&”,$xml );
in function nusoap_parser before following line