Issues

ZF-5689: ArrayOf<Type> in wsdl - Zend_Soap_Autodiscovery

Description

I guess it is a bug.. if I use Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence and write docblock for method like this:


/** 
 * @param string $session_id
 * @param string[] $type 
 * @param string[] $status 
 * @param string[] $registrar 
 * @return object
 */

I get in wsdl:


only first string[] argument has wsdl type ArrayOfString other have 'string[]'. That is also true for int[] and other arrays.

Comments

Can you please verify that this has been fixed in ZF 1.7.4? I closed a similar bug for this release, see Ticket ZF-5430

Yes, it's OK in 1.7.4. Thanks.

I noticed one more thing about arrays that comes from client request. This is part of soap xml that client send to my zend soap server:

     <type xsi:type="web:ArrayOfString">
        <!--Zero or more repetitions:-->
            <item xsi:type="xsd:string">1</item>
    <item xsi:type="xsd:string">2</item>
            <item xsi:type="xsd:string">3</item>
     </type>

and for $type argument of my method I get:

    stdClass Object
    (
        [item] => Array
            (
                [0] => 1
                [1] => 2
                [2] => 3
            )
    )

but if client send this xml in request (only one item):

     <type xsi:type="web:ArrayOfString">
        <!--Zero or more repetitions:-->
            <item xsi:type="xsd:string">1</item>
     </type>

I get this for $type method argument:

           stdClass Object
            (
                [item] => all
            )

So in the second example [item] property is not an array. I guess it should be, like in first example, only with one element cause I expect array from client. Maybe this is intentional, but I always have to check if [item] is an array and if not convert it to array cause my method expects array as argument which can be, for example, passed to foreach loop.

sory, in comment above last stdClass object should look like

stdClass Object ( [item] => 1 )

not 'all' as value for [item]

this is indeed strange behaviour, but the parsing of WSDL structure and building of requests and responses of it is done by the internal PHP SOAPClient and SOAPServer we only wrap convenience functionality around it.

Ok. Thanks. You can close the ticket.