NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
SOAP Parser Sample


Joined: 22 Sep 2003
Posts: 10
Location: Spain
Reply with quote
Hi!
I'm trying nuSOAP in a PHP code, and certainly my PHP code send an XML to a SOAP server and of course receive an XML response...
Anyway, I need to parse the XML response, and I'm trying to make this with soap_parser, but... I cannot!! Can anybody send me a code sample for this?

Thanks a lot of,

Juan
View user's profileFind all posts by nunezjjSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
what was returned in $parser if you call $parser = new soap_parser($your_xml_data) ?
View user's profileFind all posts by dmitriSend private messageVisit poster's website
soap_parser return


Joined: 22 Sep 2003
Posts: 10
Location: Spain
Reply with quote
Hi,

When I use $parser = new soap_parser($xml_data);

$parser returns : "Object"

I obtained $xml_data using:

$xml_data = '<xmp>'.$soapclient->response.'</xmp>';
or
$xml_data = $soapclient->response;

Thanks
View user's profileFind all posts by nunezjjSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
What does it mean "Object" ?
Have you seen it when you ran var_dump($parser); ?
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Content var_dump


Joined: 22 Sep 2003
Posts: 10
Location: Spain
Reply with quote
Sorry, with var_dump I obtained this:

object(soap_parser)(33) { ["title"]=> string(6) "NuSOAP" ["version"]=> string(3) "0.6" ["error_str"]=> bool(false) ["charencoding"]=> bool(true) ["soap_defencoding"]=> string(5) "UTF-8" ["namespaces"]=> array(0) { } ["typemap"]=> array(4) { ["http://www.w3.org/2001/XMLSchema"]=> array(41) { ["string"]=> string(6) "string" ["boolean"]=> string(7) "boolean" ["float"]=> string(6) "double" ["double"]=> string(6) "double" ["decimal"]=> string(6) "double" ["duration"]=> string(0) "" ["dateTime"]=> string(6) "string" ["time"]=> string(6) "string" ["date"]=> string(6) "string" ["gYearMonth"]=> string(0) "" ["gYear"]=> string(0) "" ["gMonthDay"]=> string(0) "" ["gDay"]=> string(0) "" ["gMonth"]=> string(0) "" ["hexBinary"]=> string(6) "string" ["base64Binary"]=> string(6) "string" ["normalizedString"]=> string(6) "string" ["token"]=> string(6) "string" ["language"]=> string(0) "" ["NMTOKEN"]=> string(0) "" ["NMTOKENS"]=> string(0) "" ["Name"]=> string(0) "" ["NCName"]=> string(0) "" ["ID"]=> string(0) "" ["IDREF"]=> string(0) "" ["IDREFS"]=> string(0) "" ["ENTITY"]=> string(0) "" ["ENTITIES"]=> string(0) "" ["integer"]=> string(7) "integer" ["nonPositiveInteger"]=> string(7) "integer" ["negativeInteger"]=> string(7) "integer" ["long"]=> string(0) "" ["int"]=> string(7) "integer" ["short"]=> string(0) "" ["byte"]=> string(0) "" ["nonNegativeInteger"]=> string(7) "integer" ["unsignedLong"]=> string(0) "" ["unsignedInt"]=> string(0) "" ["unsignedShort"]=> string(0) "" ["unsignedByte"]=> string(0) "" ["positiveInteger"]=> string(0) "" } ["http://www.w3.org/1999/XMLSchema"]=> array(11) { ["i4"]=> string(0) "" ["int"]=> string(7) "integer" ["boolean"]=> string(7) "boolean" ["string"]=> string(6) "string" ["double"]=> string(6) "double" ["float"]=> string(6) "double" ["dateTime"]=> string(6) "string" ["timeInstant"]=> string(6) "string" ["base64Binary"]=> string(6) "string" ["base64"]=> string(6) "string" ["ur-type"]=> string(5) "array" } ["http://soapinterop.org/xsd"]=> array(1) { ["SOAPStruct"]=> string(6) "struct" } ["http://schemas.xmlsoap.org/soap/encoding/"]=> array(3) { ["base64"]=> string(6) "string" ["array"]=> string(5) "array" ["Array"]=> string(5) "array" } } ["xmlEntities"]=> array(5) { ["quot"]=> string(1) """ ["amp"]=> string(1) "&" ["lt"]=> string(1) "<" ["gt"]=> string(1) ">" ["apos"]=> string(1) "'" } ["xml"]=> string(2605) "HTTP/1.0 200 OK Document follows Server: SoapServer Content-type: text/xml Content-Length: 2503 0 16 0 649450144 0 0 0 0 0 0 0 0 false false ProxyListenerID=FFQMSXLPYB1064314636617 clientInterfaceName=soap clientInterfaceClass=eigroup.sms.clients.smssoap.SMSSoap Prueba desde PHP-SOAP 2 " ["xml_encoding"]=> string(5) "UTF-8" ["method"]=> string(0) "" ["root_struct"]=> string(0) "" ["root_struct_name"]=> string(0) "" ["root_header"]=> string(0) "" ["status"]=> string(0) "" ["position"]=> int(0) ["depth"]=> int(0) ["default_namespace"]=> string(0) "" ["message"]=> array(0) { } ["fault"]=> bool(false) ["fault_code"]=> string(0) "" ["fault_str"]=> string(0) "" ["fault_detail"]=> string(0) "" ["errstr"]=> string(52) "XML error on line 1: not well-formed (invalid token)" ["depth_array"]=> array(0) { } ["debug_flag"]=> bool(true) ["debug_str"]=> string(115) "soap_parser: Entering soap_parser() soap_parser: parse error: XML error on line 1: not well-formed (invalid token) " ["soapresponse"]=> NULL ["responseHeaders"]=> string(0) "" ["ids"]=> array(0) { } ["multirefs"]=> array(0) { } ["entities"]=> array(5) { ["&"]=> string(5) "&" ["<"]=> string(4) "<" [">"]=> string(4) ">" ["'"]=> string(6) "&apos;" ["""]=> string(6) """ } ["parser"]=> resource(4) of type (Unknown) }
View user's profileFind all posts by nunezjjSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
so you actually got all you need Smile
the content was parsed and you can traverse the object properties to see all the parsed results.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Thanks


Joined: 22 Sep 2003
Posts: 10
Location: Spain
Reply with quote
Thank you, but.... I'm yet a bit Confused ...
Could you give me a concret sample please? i.e., I want to see the content of the tag destAddr... how can I do this?

Thanks a lot of for you quickly help...

Bye2
View user's profileFind all posts by nunezjjSend private message
SOAP Parser Sample
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic