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>so me 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('UserCont ext' =$uc, 'allItems' =$theitems);
$soapclient->SyncItems($par ams);
?>
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!W bshjti!=ojdlAwb shjti/psh?\v\1");}