Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用php将数组传递到wsdl文件不会';我不能正常工作_Php_Arrays_Soap_Wsdl_Complextype - Fatal编程技术网

使用php将数组传递到wsdl文件不会';我不能正常工作

使用php将数组传递到wsdl文件不会';我不能正常工作,php,arrays,soap,wsdl,complextype,Php,Arrays,Soap,Wsdl,Complextype,我在my client.php中定义了一个数组: $array=array(13,“Maria”、“Mueller”) 我使用$result1=$client->\uu soapCall(“函数”,数组($array))传递它到wsdl文件 在我的wsdl中,它是这样写的: <xsd:complexType name='function'> <xsd:sequence> <

我在my client.php中定义了一个数组:

$array=array(13,“Maria”、“Mueller”)

我使用
$result1=$client->\uu soapCall(“函数”,数组($array))传递它到wsdl文件

在我的wsdl中,它是这样写的:

            <xsd:complexType name='function'>
                <xsd:sequence>
                    <xsd:element name='item' type='xsd:string' maxOccurs='unbounded'/>
                </xsd:sequence>
            </xsd:complexType>

我认为我的wsdl工作不正常。我不明白为什么它会工作,即使数组中的一个值是整数值。我还使用简单类型,当我将一个整数值传递给一个定义为字符串的元素时,它就不起作用了。现在我想知道,当我定义所有内容都应该是字符串时,它也不能处理数组中的整数13。 因为我也有只允许包含整数的数组,当字符串值出现在这个数组中时,我的wsdl不应该传递那个数组


问候语

我让它与:

xmlns:soapenc=”http://schemas.xmlsoap.org/soap/encoding/"

在类型中:

        <xsd:complexType name="function1">
            <xsd:complexContent>
                <xsd:restriction base="soapenc:Array">
                    <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:integer"/>
                </xsd:restriction>
            </xsd:complexContent>
        </xsd:complexType>

对于字符串:

        <xsd:complexType name="function1">
            <xsd:complexContent>
                <xsd:restriction base="soapenc:Array">
                    <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string"/>
                </xsd:restriction>
            </xsd:complexContent>
        </xsd:complexType>

在信息中:

<wsdl:message name="createRequest1">
    <wsdl:part name="array" type='tns:function1'/>
</wsdl:message>

资料来源: