RE: [SOAP] PHP array problem <ns4:item>
| From: | Mike Carter | Date: | Wed, 26 Nov 2003 12:37:15 +0000 |
| Subject: | RE: [SOAP] PHP array problem <ns4:item> | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-1178@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Thomas Ashbee [mailto:thomas@merinet.com]
> Sent: 25 November 2003 13:06
> To: soap@lists.php.net
> Subject: [SOAP] PHP array problem <ns4:item>
>
> How do i stop the <ns4:item> being inserted in to the request
>
>
> $message_array = array(
> array('originator' => 'originatorno',
> 'recipient' => 'recipentno',
> 'body' => 'This is a test message',
> 'type' => 'Text',
> 'validityperiod' => '10'),
> array('originator' => 'originatorno',
> 'recipient' => 'recipentno',
> 'body' => 'This is a test message',
> 'type' => 'Text',
> 'validityperiod' => '10')
> );
>
> $secondarray = array('messagesubmission' => $message_array);
>
Use objects rather than nested arrays to put your attributes in. I use a
stdClass like:
$req = new StdClass;
$req->originator = 'originatorno';
$req->recipient = 'recipentno';
Etc...
Then add this class to the parent class (if your nesting things) before
submitting it to the webservice.
Regards,
Mike C.
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________