note 97151 added to simplexmlelement.construct
| From: | uramihsayibok at osu1 dot php dot net | Date: | Sun, 04 Apr 2010 22:30:26 +0000 |
| Subject: | note 97151 added to simplexmlelement.construct | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-167697@lists.php.net to get a copy of this message | ||
@zwilson (19-Nov-2009)
I haven't seen SimpleXML have any problems with SOAP. The issue is whether you know how to
properly deal with the result. Yes, namespaces in SimpleXML aren't terribly simple (a
->{"soap:Envelope"} syntax would be wonderful) but they're certainly manageable.
Using W3School's example SOAP response* (http://www.w3schools.com/SOAP/soap_example.asp):
<?php
$xml = new SimpleXMLElement("...", 0, false);
define("NS_M", "http://www.example.org/stock");
define("NS_SOAP", "http://www.w3.org/2001/12/soap-envelope");
// the price
echo (string)$xml
->children(NS_SOAP)->Body
->children(NS_M)->GetStockPriceResponse
->Price;
?>
Why deform the response when you can just deal with it?
(* Not posted because it doesn't pass the spam filter)
----
Server IP: 208.69.120.55
Probable Submitter: 69.166.47.131
----
Manual Page -- http://www.php.net/manual/en/simplexmlelement.construct.php
Edit -- https://master.php.net/note/edit/97151
Del: integrated -- https://master.php.net/note/delete/97151/integrated
Del: useless -- https://master.php.net/note/delete/97151/useless
Del: bad code -- https://master.php.net/note/delete/97151/bad+code
Del: spam -- https://master.php.net/note/delete/97151/spam
Del: non-english -- https://master.php.net/note/delete/97151/non-english
Del: in docs -- https://master.php.net/note/delete/97151/in+docs
Del: other reasons-- https://master.php.net/note/delete/97151
Reject -- https://master.php.net/note/reject/97151
Search -- https://master.php.net/manage/user-notes.php