如何在PHP中将数组传递给SOAP

时间:2014-02-06 17:54:40

标签: php soapserver

我想用SOAP传递这个数组

'DeviceList'=>array('Devices'=>
        array(
           array('DeviceID'=>'teltec12347'),
           array('DeviceID'=>'teltec12347'),      
        )
    )

我的SOAP服务器如下:

 $server->wsdl->addComplexType(
    'DeviceList',
    'complexType',
    'struct',
    '',
    '',
    array(
        'Devices'=> array('name'=>'Devices','type'=>'tns:DeviceArray')  
   )
);

$server->wsdl->addComplexType(
    'DeviceArray',
    'complexType',
    'array',
    'secuence',
    '',
    array(
        'DeviceID'     => array('name'=>'DeviceID','type'=>'xsd:string'), 
    ),
    'tns:DeviceList'
);
$server->register('shipmentDelivery',
    array(
    'ShopID'=>'xsd:int',
    'Password'=>'xsd:string',
    'ShipmentID'=>'xsd:string',
    'StartDate'=>'xsd:string',
    'EndDate'=>'xsd:string',
    'DeviceList'=>'tns:DeviceList'),
    array('return'=>'xsd:string'), 
    'urn:canaiwsdl',
    'urn:canaiwsdl#shipmentDelivery',
    'rpc',
    'encoded',
    'Hardware list'
);

我有这样的事情。 如果我传递密码或startDate一切正常,但是当我想传递数组时会出现问题。我怎样才能正确传递数组?

0 个答案:

没有答案