
March 5th, 2008, 02:24 AM
|
|
Registered User
|
|
Join Date: Aug 2007
Posts: 3
Time spent in forums: 2 h 41 m 3 sec
Reputation Power: 0
|
|
|
Soap servers and complex data types
Hi all.
I am currently creating a Soap server to return some data. The data it returns is an array so I have created a complex data type...
Problem is, is that when there is only one row of data, I get an error.
My data comes from a mysql strored procedure.
Here is the code to create the complex data type abd register the function
Code:
// add a complex data type to be used as output
$server -> wsdl -> addComplexType("return_data_array"
, "complexType"
, "struct"
, "all"
, ""
, array("task_title" => array("name" => "task_title" , "type" => "xsd:string")
, "message" => array("name" => "message" , "type" => "xsd:string")));
$server ->wsdl -> addComplexType("return_data"
, "complexType"
, "array"
, ""
, "SOAP-END:Array"
, array()
, array(
array(
"ref" => "SOAP-END:arrayType","wsdl:arrayType" => "tns:return_data_array[]"
)
)
, "tns:return_data_array");
$server -> register("task_get_task_list"
, array("user_id" => "xsd:string")
, array("return" => "tns:return_data")
, "urn:task_get_task_listwsdl"
, "urn:task_get_task_listwsdl#task_get_task_list");
Does anybody know why this is happening?
Any help will be appreciated
|