Re: [SOAP] SOAP call with multiple elements in a list

[email protected] (NAVEEN) Tue, 30 Oct 2012 16:41:03 -0700 (PDT)
Newsgroups php.soap
Message-ID <[email protected]>
---2097669038-176241185-1351640463=:35517
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

I think customer should be array of stdClass objects not class itself.=0A=
=0AstdClass customers=0A{=0A=A0=A0=A0=A0 customer =3D array(object1, object=
2, ..., objectN)=0A}=0A=0A=0Awhere objectN is stdClass which has 2 attribut=
es name and address.=0A=0A=0AHope this helps.=0A=0A=0A=0A=0A=0A----- Origin=
al Message -----=0AFrom: edmond shabanian <[email protected]>=0ATo: soap@=
lists.php.net=0ACc: =0ASent: Wednesday, 31 October 2012, 3:50=0ASubject: [S=
OAP] SOAP call with multiple elements in a list=0A=0AI have a web service t=
hat I'm trying to call from PHP using SoapClient for=0Awhich I have been su=
pplied a WSDL. Part of the request that I'm supposed to=0Asend is a list.=
=A0 Example being a list of customers.=A0 The wsdl calls for=0Asomething li=
ke this:=0A=0A=A0 =A0 =A0 =A0 =A0 =A0 <Customers>=0A=A0 =A0 =A0 =A0 =A0 =A0=
 =A0  <!--Zero or more repetitions:-->=0A=A0 =A0 =A0 =A0 =A0 =A0 =A0  <Cust=
omer>=0A=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <Name></Name>=0A=A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 <Address></Address>=0A=A0 =A0 =A0 =A0 =A0 =A0 =A0  <Cu=
stomer>=0A=A0 =A0 =A0 =A0 =A0 =A0 <Customers>=0A=0AThe problem is that ther=
e is no way that I'm aware of in PHP to represent=0Asuch a list.=A0 If I cr=
eate an array or a std_class object containing=0Acustomer information, each=
 element is indexed, i.e.=0A=0ACustomers =3D Array[2]=0A0 =3D Object=0A=A0 =
=A0 Customer =3D Object=0A=A0 =A0 =A0 =A0 =A0 Name =3D Smith=0A=A0 =A0 =A0 =
=A0 =A0 Address =3D Easy St.=0A1 =3D Object=0A=A0 =A0  Customer =3D Obect=
=0A=A0 =A0  . . . and so on=0A=0AIt seems that PHP enforces a rule where th=
er must be unique id for reach=0Aelement of an array or object.=A0 When I s=
ubmit this request to SOAP, only=0Athe first element of the Customer object=
 makes it into the request.=A0 I've=0Aseen other posts for similar problems=
 on other boards, but am unclear as to=0Athe best solution, if there really=
 is a solution at all.=0A=0A=0A=0A-- =0AEd Shabanian=0A
---2097669038-176241185-1351640463=:35517--