Buduję sobie SOAP server, chcę aby można było przekazać taką strukturę
<soap:Envelope> <soap:Body> <shipmentDeliveryRequest> <ShopID>5413879</ShopID> <password>5413879</password> <shipmentID>5413879-SP55914</shipmentID> <startDate>2014-02-01</startDate> <endDate>2014-02-05</endDate> <DeviceList> <DeviceID>teltec12345</DeviceID> <DeviceID>teltec12346</DeviceID> <DeviceID>teltec12347</DeviceID> <DeviceID>teltec12353</DeviceID> <DeviceID>teltec12354</DeviceID> <DeviceID>teltec12356</DeviceID> <DeviceID>teltec12392</DeviceID> <DeviceID>teltec12393</DeviceID> </DeviceList> </shipmentDeliveryRequest> </soap:Body> </soap:Envelope>
Napisałem taki serwer
/* * ============================================== * shipmentDelivery * ============================================== */ $server->wsdl->addComplexType( 'DeviceList', 'complexType', 'struct', '', '', ) ); $server->wsdl->addComplexType( 'DeviceArray', 'complexType', 'array', 'sequence', '', ), 'tns:DeviceList' ); $server->register('shipmentDelivery', 'ShopID'=>'xsd:int', 'Password'=>'xsd:string', 'ShipmentID'=>'xsd:string', 'StartDate'=>'xsd:string', 'EndDate'=>'xsd:string', 'DeviceList'=>'tns:DeviceList'), 'urn:canaiwsdl', 'urn:canaiwsdl#shipmentDelivery', 'rpc', 'encoded', 'Hardware list' );
Następnie próbuje przesłać taki dane
'ShopID'=>5413879, 'Password'=>'tajnehaslo', 'ShipmentID'=>'5413879-SP55914', 'StartDate'=>'2014-02-05', 'EndDate'=>'2014-02-07', 'DeviceList'=>array('Devices'=> ) ) ); $result = $client->call('shipmentDelivery', $param);
Problemem jest to, że tablica DeviceList jest niepoprawnie zbudowana ponieważ w funkcji otrzymuje pustą tablicę Devices.
Nie wiem jak to powinno dobrze działać np. Password, ShopID sa poprawnie przekazywane