This is part of my file wsdl:
Code:
<xsd:element name="items" type="itemsType" />
<xsd:complexType name="itemsType">
<xsd:complexContent>
<xsd:restriction base="SOAP-ENC:Array">
<xsd:sequence>
<xsd:element name="id" type="xsd:string" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="result" type="xsd:string" />
Server:
PHP Code:
function search($tab)
{
return print_r($tab, true);
}
$server = new SoapServer('http://localhost:82/soap_test/wsdl/wsdl.php');
$server->addFunction("search");
$server->handle();
client:
PHP Code:
$tab_ws->id[0] = 'a235g';
//$tab_ws->id[1] = 'b68fg';
$client = new SoapClient('http://localhost:82/soap_test/wsdl/wsdl.php');
$tab = $client->search($tab_ws);
print_r($tab);
Client show me result:
Code:
stdClass Object ( [id] => a235g )
But I need result:
Code:
stdClass Object ( [id] => Array ( [0] => a235g ) )
What am I doing wrong ?
Bookmarks