PDA

View Full Version : مشکل ورودی پارامتر آرایه چند بعدی در یک تابع وب سرویس



aminpourazadeh
دوشنبه 21 اردیبهشت 1394, 19:01 عصر
در وب سرویس php یک متغیر 'arrayProducts' به این صورت تعریف می کنم


$server->wsdl->addComplexType(
'arrayProducts', // name
'complexType', // typeClass: complexType, simpleType, attribute
'struct', // phpType: array, struct (php assoc array)
'all', // compositor: all, sequence, choice
'', // restrictionBase e.g.: SOAP-ENC:Array
array
(
'product' => array('name' => 'product' , 'type' => 'xsd:string'),
'quantity' => array('name' => 'quantity' , 'type' => 'xsd:string'),
'weight' => array('name' => 'weight' , 'type' => 'xsd:string'),
'price' => array('name' => 'price' , 'type' => 'xsd:string'),
'oldProductNo' => array('name' => 'oldProductNo' , 'type' => 'xsd:string')
)
);

و متد AddOrderByProduct



$server->register('AddOrderByProduct', // method name
array('Name' => 'xsd:string',
'Family' => 'xsd:string',
'Gender' => 'xsd:string',
'Email' => 'xsd:string',
'Address' => 'xsd:string',
'ZIP' => 'xsd:string',
'Tel' => 'xsd:string',
'MobileNum' => 'xsd:string',
'Message' => 'xsd:string',
'DeliveryTime' => 'xsd:string',
'ID' => 'xsd:string',
'Pass' => 'xsd:string',
'City' => 'xsd:string',
'Province' => 'xsd:string',
'Delivery' => 'xsd:string',
'Products' => 'xsd:arrayProducts',
'discount' => 'xsd:string',
'PaymentMethod'=> 'xsd:string'
),
// input parameters
array('return' => 'xsd:string'), // output parameters
'urn:p', // namespace
'urn:p#AddOrderByProduct', // soapaction
'rpc', // style
'encoded', // use
'for more info.' // documentation
);








سپس در asp متد AddOrderByProduct از طریق وب سرویس فراخوانی می کنم
ولی نوع arrayProducts را نمی شناسد و به عنوان string پاس می دهد در صورتی که می خواهم نوع اش string[][] باشد