parse Soap Array into PHP Array -
i need on one;
i need parse soap result several php arrays.
<soap-env:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" soap-env:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"> <soap-env:body> <i2:getdataresponse id="ref-1" xmlns:i2="http://schemas.microsoft.com/clr/nsassem/teleperformance.statistics.webservice.dataservice/ctistatserver"> <return href="#ref-4"/> </i2:getdataresponse> <i3:data id="ref-4" xmlns:i3="http://www.twenty4help.com/ps/dataservice.wsdl"> <values href="#ref-5"/> </i3:data> <soap-enc:array id="ref-5" soap-enc:arraytype="xsd:anytype[][13]"> <item href="#ref-6"/> <item href="#ref-7"/> <item href="#ref-8"/> <item href="#ref-9"/> <item href="#ref-10"/> <item href="#ref-11"/> <item href="#ref-12"/> <item href="#ref-13"/> <item href="#ref-14"/> <item href="#ref-15"/> <item href="#ref-16"/> <item href="#ref-17"/> <item href="#ref-18"/> </soap-enc:array> <soap-enc:array id="ref-6" soap-enc:arraytype="xsd:anytype[5]"> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> </soap-enc:array> <soap-enc:array id="ref-7" soap-enc:arraytype="xsd:anytype[5]"> <item xsi:type="xsd:long">64</item> <item xsi:type="xsd:long">58</item> <item xsi:type="xsd:long">576</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> </soap-enc:array> <soap-enc:array id="ref-8" soap-enc:arraytype="xsd:anytype[5]"> <item xsi:type="xsd:long">21</item> <item xsi:type="xsd:long">19</item> <item xsi:type="xsd:long">140</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> </soap-enc:array> <soap-enc:array id="ref-9" soap-enc:arraytype="xsd:anytype[5]"> <item xsi:type="xsd:long">36</item> <item xsi:type="xsd:long">34</item> <item xsi:type="xsd:long">49</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> </soap-enc:array> <soap-enc:array id="ref-10" soap-enc:arraytype="xsd:anytype[5]"> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> </soap-enc:array> <soap-enc:array id="ref-11" soap-enc:arraytype="xsd:anytype[5]"> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> </soap-enc:array> <soap-enc:array id="ref-12" soap-enc:arraytype="xsd:anytype[5]"> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> </soap-enc:array> <soap-enc:array id="ref-13" soap-enc:arraytype="xsd:anytype[5]"> <item xsi:type="xsd:long">51</item> <item xsi:type="xsd:long">49</item> <item xsi:type="xsd:long">70</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> </soap-enc:array> <soap-enc:array id="ref-14" soap-enc:arraytype="xsd:anytype[5]"> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> </soap-enc:array> <soap-enc:array id="ref-15" soap-enc:arraytype="xsd:anytype[5]"> <item xsi:type="xsd:long">10</item> <item xsi:type="xsd:long">10</item> <item xsi:type="xsd:long">13</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> </soap-enc:array> <soap-enc:array id="ref-16" soap-enc:arraytype="xsd:anytype[5]"> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> </soap-enc:array> <soap-enc:array id="ref-17" soap-enc:arraytype="xsd:anytype[5]"> <item xsi:type="xsd:long">5</item> <item xsi:type="xsd:long">5</item> <item xsi:type="xsd:long">8</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> </soap-enc:array> <soap-enc:array id="ref-18" soap-enc:arraytype="xsd:anytype[5]"> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> <item xsi:type="xsd:long">0</item> </soap-enc:array> </soap-env:body> </soap-env:envelope>
i need ref-6 till ref-18 in seperate php arrays every ref ref-6 on phone queue call data in it. in case expect 13 php arrays $queue1, $queue2, etc. can use arrays in webscipt display amount of calls per queue
<?php echo $queue2[2] ?> //answer 140 ref-8 has value 140 @ place 3
please don't give me lecture callcenter supervisor scripting skills. noob :)
i got far:
for testing purposes use local file xml1.xml soap output stored. $xml $result in final code.
<?php if (file_exists('xml1.xml')) { $xml = simplexml_load_file('xml1.xml'); } else { exit('failed open xml1.xml.'); } $xml->registerxpathnamespace('soap', 'http://schemas.xmlsoap.org/soap/envelope/'); foreach ($xml->xpath('//soap-enc:array') $item) { //creaate array code should here, know how it. print_r ($item); } ?>
thank teaching me lesson :) , helping me this.
Comments
Post a Comment