Click here to get back home

PHP SOAP client and tag attributes

 HomeNewsGroups | Search | About
 comp.lang.php    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
PHP SOAP client and tag attributes willscotttellus 08-02-2008
Get Chitika Premium
Posted by willscotttellus on August 2, 2008, 9:52 pm
Please log in for more thread options
I have a SOAP service returning this to me

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://
www.w3.org/1999/XMLSchema-instance">
<soapenv:Body>
<ns1:exportStationCodesXMLResponse soapenv:encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://uri.not">
<exportStationCodesXMLReturn xsi:type="ns2:Document"
xmlns:ns2="http://xml.apache.org/xml-soap">
<nds>
<data>
<r>
<c v="NERR_Site_ID"/>
<c v="Station_Code"/>
<c v="Station_Name"/>
<c v="Lat_Long"/>
<c v="Latitude"/>
<c v="Longitude"/>
<c v="Status"/>
<c v="Active_Dates"/>
<c v="Params_Reported"/>
</r>
<r>
<c v="ace "/>
<c v="acebbnut "/>
<c v="Big Bay "/>
<c v="32&#xB0; 29' 22.92 N, 80&#xB0; 19' 12.72 W"/>
<c v="32.4897"/>
<c v="80.3202"/>
<c v="Active "/>
<c v="Feb 2002-"/>
<c v="PO4F,NH4F,NO2F,NO3F,NO23F,DIN,CHLA_N"/>.....

I wrote a small php sample call like so:

<?php
$wsdl=new SoapClient('http://cdmo.baruch.sc.edu/webservices/
xmldatarequest.cfc?wsdl', array('trace' => 1));
$result = $wsdl->exportStationCodesXML();
var_dump($result);

//echo "RESPONSE:\n" . $wsdl->__getLastResponse() . "\n";

?>

But what I get back are a bunch of arrays of empty strings like so

object(stdClass)#2 (1) { ["nds"]=> object(stdClass)#3 (1)
{ ["data"]=> object(stdClass)#4 (1) { ["r"]=> array(301) { [0]=>
object(stdClass)#5 (1) { ["c"]=> array(10) { [0]=> string(0)
"" [1]=> string(0) "" [2]=> string(0) "" [3]=> string(0) "" [4]=>
string(0) "" [5]=> string(0) "" [6]=> string(0) "" [7]=> string(0)
"" [8]=> string(0) "" [9]=> string(0) "" } } [1]=>
object(stdClass)#6 (1) { ["c"]=> array(10) { [0]=> string(0)
"" [1]=> string(0) "" [2]=> string(0) "" [3]=> string(0) "" [4]=>
string(0) "" [5]=> string(0) "" [6]=> string(0) "" [7]=> string(0)
"" [8]=> string(0) "" [9]=> string(0) "" } } [2]=>
object(stdClass)#7 (1) { ["c"]=> array(10) { [0]=> string(0)
"" [1]=> string(0) "" [2]=> string(0)....

(I dont think you will be able to run my code, as my ip is trusted to
execute the WS only)

My question is I NEED to get to those attributes (the 'v=') and I
would rather not do it by reparsing the response (from
__getLastResponse). What am I missing??!?!?

Similar ThreadsPosted
PHP SOAP and setting attributes February 10, 2006, 8:17 am
soap client for apache soap server. April 23, 2007, 6:43 am
PHP5 SOAP Attributes (Redux) February 10, 2006, 1:41 pm
Need SOAP/Client help June 27, 2005, 11:11 pm
SOAP Client timeout June 5, 2007, 5:31 pm
SOAP : PHP client /Java server July 12, 2005, 7:40 am
create SOAP-Client and send files March 29, 2005, 4:09 am
PHP client web services - save soap attachment. February 2, 2007, 4:00 am
Calling Pear SOAP Service from gSOAP Client March 28, 2005, 6:45 am
Making Webservice call (SOAP Client) Call Using PHP. July 5, 2007, 9:13 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap