Witam
Buduję sobie SOAP server, chcę aby można było przekazać taką strukturę

  1. <soap:Envelope>
  2. <soap:Body>
  3. <shipmentDeliveryRequest>
  4. <ShopID>5413879</ShopID>
  5. <password>5413879</password>
  6. <shipmentID>5413879-SP55914</shipmentID>
  7. <startDate>2014-02-01</startDate>
  8. <endDate>2014-02-05</endDate>
  9. <DeviceList>
  10. <DeviceID>teltec12345</DeviceID>
  11. <DeviceID>teltec12346</DeviceID>
  12. <DeviceID>teltec12347</DeviceID>
  13. <DeviceID>teltec12353</DeviceID>
  14. <DeviceID>teltec12354</DeviceID>
  15. <DeviceID>teltec12356</DeviceID>
  16. <DeviceID>teltec12392</DeviceID>
  17. <DeviceID>teltec12393</DeviceID>
  18. </DeviceList>
  19. </shipmentDeliveryRequest>
  20. </soap:Body>
  21. </soap:Envelope>


Napisałem taki serwer

  1. /*
  2. * ==============================================
  3. * shipmentDelivery
  4. * ==============================================
  5. */
  6. $server->wsdl->addComplexType(
  7. 'DeviceList',
  8. 'complexType',
  9. 'struct',
  10. '',
  11. '',
  12. 'Devices' => array('name'=>'Devices','type'=>'tns:DeviceArray')
  13. )
  14. );
  15.  
  16. $server->wsdl->addComplexType(
  17. 'DeviceArray',
  18. 'complexType',
  19. 'array',
  20. 'sequence',
  21. '',
  22. 'DeviceID' => array('name'=>'DeviceID','type'=>'xsd:string'),
  23. ),
  24. 'tns:DeviceList'
  25. );
  26. $server->register('shipmentDelivery',
  27. 'ShopID'=>'xsd:int',
  28. 'Password'=>'xsd:string',
  29. 'ShipmentID'=>'xsd:string',
  30. 'StartDate'=>'xsd:string',
  31. 'EndDate'=>'xsd:string',
  32. 'DeviceList'=>'tns:DeviceList'),
  33. array('return'=>'xsd:string'),
  34. 'urn:canaiwsdl',
  35. 'urn:canaiwsdl#shipmentDelivery',
  36. 'rpc',
  37. 'encoded',
  38. 'Hardware list'
  39. );


Następnie próbuje przesłać taki dane

  1. $param =array(
  2. 'ShopID'=>5413879,
  3. 'Password'=>'tajnehaslo',
  4. 'ShipmentID'=>'5413879-SP55914',
  5. 'StartDate'=>'2014-02-05',
  6. 'EndDate'=>'2014-02-07',
  7. 'DeviceList'=>array('Devices'=>
  8. array('DeviceID'=>'teltec12347'),
  9. array('DeviceID'=>'teltec12347'),
  10. )
  11. )
  12. );
  13.  
  14. $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