Anonymous - 2011-03-30

Hello

I have a function UploadFile that accepts parameter defined in wsdl types section:

<xsd:element name="UploadFileRequestParameters">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="FileName" type="xsd:string"/>
            <xsd:element name="Append" type="xsd:boolean"/>                    
            <xsd:element name="Data" type="xsd:base64Binary"/>           
        </xsd:sequence>
    </xsd:complexType>
</xsd:element>

Here is the php function.

function UploadFile($parameter) {
    ....
}

Problem is that if I call this with

$client->call("UploadFile", array('Parameter' => array('FileName' => 'a', 'Append' => 1, 'Data' => '...')));

i can only see FileName value in $parameter.

If I modify the type to

<xsd:element name="UploadFileRequestParameters">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="Values">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="FileName" type="xsd:string"/>
                        <xsd:element name="Append" type="xsd:boolean"/>                    
                        <xsd:element name="Data" type="xsd:base64Binary"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>
</xsd:element>

And call my function with

$client->call("UploadFile", array('Parameter' => array('Values' => array('FileName' => 'a', 'Append' => 1, 'Data' => '...'))));

everything works fine (I can see Append and Data values in $parameter)

Why is that? Is that a bug in nusoap or is that because of some standard?