我正在尝试从 php 调用一些 wsdl 函数。
假设我有这两个功能:
**listStyleCategories**
Input:
<xs:complexType name="listStyleCategories">
<xs:sequence>
<xs:element name="arg0" type="xs:string" minOccurs="0"/>
</xs:sequence>
Output:
<xs:complexType name="listStyleCategoriesResponse">
<xs:sequence>
<xs:element name="return" type="tns:listStyleCategoriesOutputBean" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="listStyleCategoriesOutputBean">
<xs:sequence>
<xs:element name="categories" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="statusInfo" type="xs:int" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
**listStyleTypes**
Input:
<xs:complexType name="listStyleTypes">
<xs:sequence>
<xs:element name="arg0" type="tns:listStyleTypesInputBean" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="listStyleTypesInputBean">
<xs:sequence>
<xs:element name="category" type="xs:string" minOccurs="0"/>
<xs:element name="language" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
Output:
<xs:complexType name="listStyleTypesResponse">
<xs:sequence>
<xs:element name="return" type="tns:listStyleTypesOutputBean" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="listStyleTypesOutputBean">
<xs:sequence>
<xs:element name="detail" type="tns:listStyleTypesOutputDetailBean" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="statusInfo" type="xs:int" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="listStyleTypesOutputDetailBean">
<xs:sequence>
<xs:element name="icon" type="xs:base64Binary" minOccurs="0"/>
<xs:element name="styleId" type="xs:int" minOccurs="0"/>
<xs:element name="type" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
当我调用第一个参数时,一切正常:
$param = array('arg0' =>$language);
$result = $client->listStyleCategories($param);
$result_arr = objectToArray($result);
echo "<pre>";print_r($result_arr);echo "</pre>";
但是当我用两个参数调用第二个函数时,我得到一个 UNEXPECTED_ERROR:
$param = array('category' =>'Woman','language'=>$language);
$result = $client->listStyleTypes($param);
$result_arr = objectToArray($result);
echo "<pre>";print_r($result_arr);echo "</pre>";
我很清楚“女性”类别和定义的语言是正确的。也许我正在构建错误的参数?
提前致谢。