我试图从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>";
我很清楚“女人”类别和定义的语言是正确的。也许我错误地建立了参数?
提前致谢。
答案 0 :(得分:0)
我会尝试这样的事情:
$params = array('arg0' => array('category' =>'Woman','language'=>$language));
$result = $client->listStyleTypes($param);
您的listStyleTypes
函数与listStyleCategories
类似,只是arg0
是两个值的复杂类型(哈希)。