SOAP Call with multiple occurences of an element
- From: Nick Vargish <nav+posts@xxxxxxxxxxxxxxxx>
- Date: 02 Oct 2008 14:09:15 -0400
Hi,
I'm a little bit stuck trying to send a SOAP request that includes
multiple occurrences of an element.
For the sake of illustration, this is what the relevant portions of
the SOAP request should look like:
<SyncItems>
<UserContext>
<UserID>some id</UserID>
<AuthToken>some token</AuthToken>
</UserContext>
<allItems>
<anItem>
<name>Item One</name>
<type>Rocket parts</type>
</anItem>
<anItem>
<name>Item Two</name>
<type>Bear skins</type>
</anItem>
<allItems>
</SyncItems>
Here is some PHP code that illustrates how I would construct the
parameters for the call, except I'm not sure how I create the
"allItems" element:
<?php
$uc = array('UserID' => 'fred', 'AuthToken' => 'a48bf35-24525fea-3c43a25');
$i1 = array('name' => 'Item One', 'type' => 'Rocket parts');
$i2 = array('name' => 'Item Two', 'type' => 'Bear skins');
// how do I create $theitems so that the $params array created below
// will work?
$params = array('UserContext' => $uc, 'allItems' => $theitems);
$soapclient->SyncItems($params);
?>
I tried the obvious approach:
$item1 = array('anItem' => $i1);
$item2 = array('anItem' => $i2);
$theitems = array($item1, $item2);
But when I do that, the SOAP client call fails so badly I can't even
get trace information back.
I've been googling for others who may have solved this problem, but I
haven't seen anyone with answers.
Any help or suggestions would be much appreciated!
Nick
--
#include<stdio.h> /* sigmask (sig.c) 20041028 PUBLIC DOMAIN */
int main(c,v)char *v;{return !c?putchar(* /* cc -o sig sig.c */
v-1)&&main(0,v+1):main(0,"Ojdl!Wbshjti!=ojdlAwbshjti/psh?\v\1");}
.
- Follow-Ups:
- Re: SOAP Call with multiple occurences of an element
- From: Nick Vargish
- Re: SOAP Call with multiple occurences of an element
- From: Jonathan Stein
- Re: SOAP Call with multiple occurences of an element
- Prev by Date: Re: I need advice on how to create thousands of articles with PHP or else
- Next by Date: Re: downloading a zip archive from another server
- Previous by thread: Re: Create passwords for multiple records (PHP/mySQL)
- Next by thread: Re: SOAP Call with multiple occurences of an element
- Index(es):