fork download
  1. <?php
  2. $xmlstr = <<< XML
  3. <?xml version="1.0" encoding="utf-8"?>
  4. <soap:Envelope xmlns:soap="http://s...content-available-to-author-only...p.org/soap/envelope/" xmlns:xsi="http://w...content-available-to-author-only...3.org/2001/XMLSchema-instance" xmlns:xsd="http://w...content-available-to-author-only...3.org/2001/XMLSchema">
  5. <soap:Body>
  6. <createClientResponse xmlns="http://v...content-available-to-author-only...o.net/">
  7. <createClientResult>
  8. <ClientID xmlns="Cangooroo.Webservice.V2.Operator"></ClientID>
  9. <ClientCode xmlns="Cangooroo.Webservice.V2.Operator"></ClientCode>
  10. <CompleteName xmlns="Cangooroo.Webservice.V2.Operator">xxxx</CompleteName>
  11. <Address xmlns="Cangooroo.Webservice.V2.Operator">yyy</Address>
  12. <Phone1 xmlns="Cangooroo.Webservice.V2.Operator">(11)11111-111</Phone1>
  13. <Email xmlns="Cangooroo.Webservice.V2.Operator">abc@abc.com.br</Email>
  14. <NotificationEmail xmlns="Cangooroo.Webservice.V2.Operator">abc@abc.com.br</NotificationEmail>
  15. <PaymentType xmlns="Cangooroo.Webservice.V2.Operator"></PaymentType>
  16. <CanSeeVoucher xmlns="Cangooroo.Webservice.V2.Operator"></CanSeeVoucher>
  17. <CityName xmlns="Cangooroo.Webservice.V2.Operator"></CityName>
  18. <CountryName xmlns="Cangooroo.Webservice.V2.Operator"></CountryName>
  19. <BaseId xmlns="Cangooroo.Webservice.V2.Operator">0</BaseId>
  20. <BaseName xmlns="Cangooroo.Webservice.V2.Operator" />
  21. <ExternalReference xmlns="Cangooroo.Webservice.V2.Operator"></ExternalReference>
  22. </createClientResult>
  23. </createClientResponse>
  24. </soap:Body>
  25. </soap:Envelope>
  26. XML;
  27.  
  28. $xml = str_ireplace(['SOAP-ENV:', 'SOAP:'], '', $xmlstr);
  29.  
  30. $doc = simplexml_load_string($xml, "SimpleXMLElement", LIBXML_NOWARNING );
  31.  
  32. var_dump( $doc);
  33.  
  34.  
  35. ?>
Success #stdin #stdout 0.02s 26280KB
stdin
Standard input is empty
stdout
object(SimpleXMLElement)#1 (1) {
  ["Body"]=>
  object(SimpleXMLElement)#2 (1) {
    ["createClientResponse"]=>
    object(SimpleXMLElement)#3 (1) {
      ["createClientResult"]=>
      object(SimpleXMLElement)#4 (14) {
        ["ClientID"]=>
        object(SimpleXMLElement)#5 (0) {
        }
        ["ClientCode"]=>
        object(SimpleXMLElement)#6 (0) {
        }
        ["CompleteName"]=>
        string(4) "xxxx"
        ["Address"]=>
        string(3) "yyy"
        ["Phone1"]=>
        string(13) "(11)11111-111"
        ["Email"]=>
        string(14) "abc@abc.com.br"
        ["NotificationEmail"]=>
        string(14) "abc@abc.com.br"
        ["PaymentType"]=>
        object(SimpleXMLElement)#7 (0) {
        }
        ["CanSeeVoucher"]=>
        object(SimpleXMLElement)#8 (0) {
        }
        ["CityName"]=>
        object(SimpleXMLElement)#9 (0) {
        }
        ["CountryName"]=>
        object(SimpleXMLElement)#10 (0) {
        }
        ["BaseId"]=>
        string(1) "0"
        ["BaseName"]=>
        object(SimpleXMLElement)#11 (0) {
        }
        ["ExternalReference"]=>
        object(SimpleXMLElement)#12 (0) {
        }
      }
    }
  }
}