|
Re: php nested array extract problem: msg#00062php.nusoap.general
The element <s:element form="unqualified" maxOccurs="unbounded" minOccurs="0" name="LocationsPairs" type="s0:LocationsPairsType"/> is what I call a doc/lit array, because it is the XML schema construct that most closely represents a programming language array. An rpc/encoded service would not use this construct, but would instead use the Array type defined by SOAP encoding. With the latest CVS revision of nusoap.php, there is client support for serializing doc/lit arrays. Specifically, the code now interprets such a construct within the WSDL as corresponding to a PHP array and creates the XML accordingly. However, NuSOAP does not yet allow the client to correctly de-serialize a SOAP payload with a doc/lit array. A NuSOAP server similarly cannot de-serialize a doc/lit array. It will get this capability at the same time the client does, which could be soon. There is the larger problem, though, that a NuSOAP server cannot truly support doc/lit WSDL. The WSDL for a NuSOAP service must be rpc/encoded. Scott Nichol Do not send e-mail directly to this e-mail address, because it is filtered to accept only mail from specific mail lists. ----- Original Message ----- From: "Stefan Sammut" <ssammut@xxxxxxxxxx> To: <nusoap-general@xxxxxxxxxxxxxxxxxxxxx> Sent: Monday, April 19, 2004 6:43 AM Subject: [Nusoap-general] php nested array extract problem Dear Mr. Scott /People, I had posted this sometime before, can you please give me some little feed back regarding this message that I had posted. This is not a mulitdimentional array. Can use a nusoap function to be able to extract it? Any help will be highly appreciated. Thanks a lot. Stefan Sammut Prev. Message Hello People, I having a problem accessing an unbounded innrer array in PHP v.4. Here is the WSDL schema request type elements. <s:element name="webStop" type="s0:JTRealTimeRequestType" /> <s:complexType name="JTRealTimeRequestType"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="StopS tatusRealTimeRequest" type="s0:StopStatusRealTimeRequestType"/> </s:sequence> </s:complexType> <s:complexType name="StopStatusRealTimeRequestType"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" form="unqualified" name=" Date" type="s:string"/> <s:element form="unqualified" maxOccurs="unbounded" minOccurs="0" n ame="LocationsPairs" type="s0:LocationsPairsType"/> </s:sequence> </s:complexType> <s:complexType name="LocationsPairsType"> <s:all> <s:element form="unqualified" maxOccurs="1" minOccurs="0" name="FromSto p" type="s0:StopType"/> <s:element form="unqualified" maxOccurs="1" minOccurs="0" name="ToSt op" type="s0:StopType"/> </s:all> </s:complexType> PHP Sample Client $LocationsPairs[]=array ( 'rt:FromStop' => array ( 'rtig:NaptanStopNumber' => 'LOC1', 'label' => 'The High Street' ), 'rt:ToStop' => array ( 'rtig:NaptanStopNumber' => 'LOC2', 'label' => 'The High Street' ) ); $LocationsPairs[]=array ( 'rt:FromStop' => array ( 'rtig:NaptanStopNumber' => 'LONE040', 'label' => 'The High Street' ), 'rt:ToStop' => array ( 'rtig:NaptanStopNumber' => 'LONE150', 'label' => 'The High Street' ) ); foreach ($LocationsPairs as $web) { $webstop_soap[] = new soapval('LocationsPairs', 'LocationsPairsType', $web); } / $JTRealTimeRequest = array ( 'rt:Date' => '19/05/2004', $webstop_soap ); $inputSoapVal=new soapval ("JTRealTimeRequest", "JTRealTimeRequestType", $JTRealTimeRequest, '', 'http://webStop.org'); $client = new soapclient('http://10.1.1.2:80/infowebjt.php'); PHP Server $locs= array($JTRealTimeRequest['LocationsPairs']); $ct = count($locs); $dt = $JTRealTimeRequest["Date"]; create_temp_table($conn_id); for ($i = 0 ; $i<$ct; $i++) { $floc1 = $locs[$i]["FromStop"]; $floc2 = $locs[$i]["ToStop"]; The $JTRealTimeRequest is passed to the server service as a parameter. WSDL parses OK, however I can't access when a have more then one element of 'LocationsPairs']); type. i.e. Only When I pass one array it works..... Any ideas please...It this a PHP issue.. Thanks in advance... Stefan Sammut ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | php nested array extract problem: 00062, Stefan Sammut |
|---|---|
| Next by Date: | Re: Nusoap-general digest, Vol 1 #512 - 2 msgs: 00062, Stefan Sammut |
| Previous by Thread: | php nested array extract problemi: 00062, Stefan Sammut |
| Next by Thread: | Re: Nusoap-general digest, Vol 1 #512 - 2 msgs: 00062, Stefan Sammut |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |