RE: [SOAP] SOAP "long" Question
| From: | Paul Miller | Date: | Wed, 26 Mar 2003 23:12:56 +0000 |
| Subject: | RE: [SOAP] SOAP "long" Question | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-511@lists.php.net to get a copy of this message | ||
My work around...
the SOAP server returns
$function_results = '
<Asset ID="13221" TYPEID="1" AVAILABILITY="Offline"
DATE="08/10/200203:40
PM">
<metadata>
<To>"Harry Ford" <HarryFord@Merck.com></To>
<From>"Ivan Lentini" <IvanLentini@Company.mil></From>
</metadata>
</Asset>';
// Quick and dirty XML parser
if ($data_array = explode(chr(34),$function_results)){
$asset_info["ID"] = $data_array[1];
$asset_info["TYPEID"] = $data_array[3];
$asset_info["AVAILABILITY"] = $data_array[5];
$asset_info["DATE"] = $data_array[7];
}
Thanks for all your help Shane. I think I have got the thing working.
Paul
-----Original Message-----
From: Shane Caraveo [mailto:shane@caraveo.com]
Sent: Wednesday, March 26, 2003 5:02 PM
To: Paul Miller
Cc: soap@lists.php.net
Subject: Re: [SOAP] SOAP "long" Question
Paul Miller wrote:
> Shane (& all),
>
> That worked. It was an implementation issue. The guy who developed it
> said, we have not seen the use 'item' in the three other system's they
> tested against.
What's the soap implementation? If they're not involved with
soapbuilders, they should be. They'll run into a few there :)
> Does anyone know how to read an attribute for a given element...
>
> <Asset ID="13221" TYPEID="1" AVAILABILITY="Offline"
> DATE="08/10/2002 03:40
> PM">
> <metadata>
> <To>"Harry Ford" <HarryFord@Merck.com></To>
> <From>"Ivan Lentini" <IvanLentini@Company.mil></From>
> </metadata>
> </Asset>
>
> I need to get the ID, TYPEID, etc. Would this be a SOAP function, an XML
> function or just a PHP interpretation issue?
It's a bit trickier. You'll have to use php objects with pear::soap,
and there should be a __set_attribute function that takes 2 args, key
and value. Then you'll also have to provide your own serialization to
get the attributes to serialize correctly. This stuff may also change
down the road.
Shane