使用php将数组传递到wsdl文件不会';我不能正常工作
我在my client.php中定义了一个数组:使用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> <
$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>
资料来源: