Przemek Berezowski - 2011-11-10 13:48:36 -
In reply to message 1 from lplover2k
Hi,
Right now arrays are recognized, but becouse of php is not strongly typed lang, they are wrapped into objects. But I've tested two behaviors
1:
On the input of webmethod there is an array of int
On the output of webmethod there is an array of int
so the code to invoke this method is:
$p2 = new TestParam_TestO2();
$p2->paramIn = array(1,2,3);
$res = $service->TestO2($p2);
print_r($res);
and the display is:
TestParam_TestO2Response Object
(
[TestO2Result] => TestParam_ArrayOfInt Object
(
[int] => Array
(
[0] => 2
[1] => 4
[2] => 6
)
)
)
Yes I know - It might be confusing , but its works :)
2:
On the input of webmethod there is an array of int
On the output of webmethod there is an array of user defined type
so the code to invoke this method is:
$p3 = new TestParam_TestO3();
$p3->paramIn = array(1,2,3);
$res = $service->TestO3($p3);
print_r($res);
and the display is:
TestParam_TestO3Response Object
(
[TestO3Result] => TestParam_ArrayOfOut3 Object
(
[Out3] => Array
(
[0] => TestParam_Out3 Object
(
[myField] => 2
)
[1] => TestParam_Out3 Object
(
[myField] => 4
)
[2] => TestParam_Out3 Object
(
[myField] => 6
)
)
)
)
confusing once again, but also works.
I will try to do something with this - but dont have time right now. I think expected behavior is to return array of object without wrapping it with extra object, so it looks like:
TestParam_TestO2Response Object
(
[TestO2Result] => Array
(
[0] => 2
[1] => 4
[2] => 6
)
)
)
--
Przemo