logo       
Bookmark and Share

How to make an soap array from a list: msg#00067

php.nusoap.general

Subject: How to make an soap array from a list

Hi there Scott and others,

I have a problem making a soap sequence from a list (array)
This is the array:

Array
(
[0] => Licht
[1] => Zwaar
[2] => LP
[3] => SB
[4] => TA
)

This array is named $SoortErkenningArray and I try to put it into an other
array like this:

$i = 0;
$soorterkenning = array();
foreach($SoortErkenningArray as $var) {
$soorterkenningstmp = array('ITEM' => $SoortErkenningArray[$i]);
array_push($soorterkenning, $soorterkenningstmp);
$i++;
}


I have this in my WSDL:

$s->wsdl->addComplexType(
'SoortErkenning',
'complexType',
'struct',
'sequence',
'',
array( 'ITEM' => array('name' => 'ITEM', 'type' => 'xsd:string')
)
);

$s->wsdl->addComplexType(
'SoortErkenningArray',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(

array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:SoortErkenning[]')
),
'tns:SoortErkenning'
);

I want to have a response like this:
<SOORTERKENNING>
<ITEM xsi:type="xsd:string">Licht</ITEM>
<ITEM xsi:type="xsd:string">Zwaar</ITEM>
<ITEM xsi:type="xsd:string">LP</ITEM>
<ITEM xsi:type="xsd:string">SB</ITEM>
<ITEM xsi:type="xsd:string">TA</ITEM>
</SOORTERKENNING>

But what I get is this:
<SOORTERKENNING xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="tns:SoortErkenning[5]">
<item xsi:type="tns:SoortErkenning"><ITEM
xsi:type="xsd:string">Licht</ITEM></item>
<item xsi:type="tns:SoortErkenning"><ITEM
xsi:type="xsd:string">Zwaar</ITEM></item>
<item xsi:type="tns:SoortErkenning"><ITEM xsi:type="xsd:string">LP</ITEM></item>
<item xsi:type="tns:SoortErkenning"><ITEM xsi:type="xsd:string">SB</ITEM>
</item><item xsi:type="tns:SoortErkenning"><ITEM
xsi:type="xsd:string">TA</ITEM></item>
</SOORTERKENNING>

Please can you help me tlelling what I am doing wrong?
Thanks for your time.

--
Jeroen[Dances with Penguins]

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.11 - Release Date: 14-4-2005



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise