<?php
$xml = '<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:getBundles">
<soapenv:Header>
<soapenv:Body>
<urn:getBundles soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<request xsi:type="urn:getBundlesRequest" xmlns:urn="urn:SelfcareWebservice">
<userid>hexa</userid>
<password>hexa123</password>
<requestid>000</requestid>
<msisdn>60182003838</msisdn>
<productname xsi:type="xsd:string"></productname>
<bundlename xsi:type="xsd:string"></bundlename>
</request>
</urn:getBundles>
</soapenv:Body>
</soapenv:Envelope>';
$sxe = new SimpleXMLElement($xml);
// Define some short identifiers for namespaces without relying on their prefix in the XML
define('NS_ENV', 'http://schemas.xmlsoap.org/soap/envelope/');
define('NS_SFORCE', 'getBundlesResponse');
// $sxe already represents the soapenv:Envelope node, so we don't need to mention that
$result = $sxe->children(NS_ENV)->Body->children(NS_SFORCE)->loginResponse->result->serverUrl;
echo $result;
Warning: SimpleXMLElement::__construct(): Entity: line 15: parser error : Opening and ending tag mismatch: Header line 2 and Envelope in /in/5lDQK on line 17
Warning: SimpleXMLElement::__construct(): </soapenv:Envelope> in /in/5lDQK on line 17
Warning: SimpleXMLElement::__construct(): ^ in /in/5lDQK on line 17
Warning: SimpleXMLElement::__construct(): Entity: line 15: parser error : Premature end of data in tag Envelope line 1 in /in/5lDQK on line 17
Warning: SimpleXMLElement::__construct(): </soapenv:Envelope> in /in/5lDQK on line 17
Warning: SimpleXMLElement::__construct(): ^ in /in/5lDQK on line 17
Fatal error: Uncaught Exception: String could not be parsed as XML in /in/5lDQK:17
Stack trace:
#0 /in/5lDQK(17): SimpleXMLElement->__construct('<soapenv:Envelo...')
#1 {main}
thrown in /in/5lDQK on line 17
Process exited with code 255.
Warning: SimpleXMLElement::__construct(): Entity: line 15: parser error : Opening and ending tag mismatch: Header line 2 and Envelope in /in/5lDQK on line 17
Warning: SimpleXMLElement::__construct(): </soapenv:Envelope> in /in/5lDQK on line 17
Warning: SimpleXMLElement::__construct(): ^ in /in/5lDQK on line 17
Warning: SimpleXMLElement::__construct(): Entity: line 15: parser error : Premature end of data in tag Envelope line 1 in /in/5lDQK on line 17
Warning: SimpleXMLElement::__construct(): </soapenv:Envelope> in /in/5lDQK on line 17
Warning: SimpleXMLElement::__construct(): ^ in /in/5lDQK on line 17
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/5lDQK:17
Stack trace:
#0 /in/5lDQK(17): SimpleXMLElement->__construct('<soapenv:Envelo...')
#1 {main}
thrown in /in/5lDQK on line 17
Process exited with code 255.
Output for 5.0.3 - 5.0.5
Warning: Entity: line 15: parser error : Opening and ending tag mismatch: Header line 2 and Envelope in /in/5lDQK on line 17
Warning: </soapenv:Envelope> in /in/5lDQK on line 17
Warning: ^ in /in/5lDQK on line 17
Warning: Entity: line 15: parser error : Premature end of data in tag Envelope line 1 in /in/5lDQK on line 17
Warning: </soapenv:Envelope> in /in/5lDQK on line 17
Warning: ^ in /in/5lDQK on line 17
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/5lDQK:17
Stack trace:
#0 /in/5lDQK(17): SimpleXMLElement->__construct('<soapenv:Envelo...')
#1 {main}
thrown in /in/5lDQK on line 17
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Warning: Entity: line 15: parser error : Opening and ending tag mismatch: Header line 2 and Envelope in /in/5lDQK on line 17
Warning: </soapenv:Envelope> in /in/5lDQK on line 17
Warning: ^ in /in/5lDQK on line 17
Warning: Entity: line 15: parser error : Premature end of data in tag Envelope line 1 in /in/5lDQK on line 17
Warning: </soapenv:Envelope> in /in/5lDQK on line 17
Warning: ^ in /in/5lDQK on line 17
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/5lDQK:17
Stack trace:
#0 {main}
thrown in /in/5lDQK on line 17
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/5lDQK on line 24
Process exited with code 255.