致命错误:未捕获的SoapFault异常:[客户端] SOAP-ERROR:编码:对象没有'iId'属性

时间:2014-03-04 13:23:46

标签: php soap

我正在尝试查询SOAP API并收到上述错误。如果我猜一下,我会说它与我的wsdl文件中的这个片段有关......

<!-- User authentication -->

    <element name="UserAuthentication">
        <complexType>
            <sequence>
                <element name="iId" type="xsd:int" />
                <element name="sPassword" type="xsd:string" />
                <element name="sType" type="api:UserType" />
            </sequence>
        </complexType>
    </element>

getSoapResults() - 你知道我把'iId'放在哪里吗?事实上,我现在还不确定“iId”与此有什么关系,当然不是整数。

<?php
public function getSoapResults() {

    $this->client = new SoapClient("http://api.example.com/v2/Example?wsdl");
    $this->header = new SoapHeader('http://api.example.com/', 'sAPIKey', '*************');
    $this->client->__setSoapHeaders($this->header);

    $oRefineByDefinition = new stdClass();
    $oRefineByDefinition->sId = 1203;
    $oRefineByDefinition->sName = '';
    $oRefineBy->oRefineByDefinition = $oRefineByDefinition;

    $aParams7 = array(
            "sQuery"        =>     "jeans",
            "bAdult"        =>  0,
            "iOffset"       =>  0,
            "iLimit"        =>  30,
            "oActiveRefineByGroup"  =>  $oRefineBy,
            "sColumnToReturn"   =>  array("sDescription","sBrand"));

   // print '<pre>';print_r($aParams7); die;

    $products = $this->client->getProductList($aParams7);

    print_r($products);
}

我已尝试将其添加到'$aParams'数组中,但这不起作用。

0 个答案:

没有答案