WSDL 解释假定的操作参数

WSDL interpret supossed operation parameters

我正在尝试调用此操作 getCountries,但我无法弄清楚读取需要参数的 WSDL 文件以及采用何种结构化方式:

http://webservice.nizacars.es/Rentway_WS/getCountries.asmx?WSDL

我已经尝试过:

$this->soap_client->getCountries(
  array(
    'countriesRequest' => array(
      'companyCode' => $this->login,
      'allCountries' => true
     )
  )
)

$this->soap_client->getCountries(
  array(
      'companyCode' => $this->login,
      'allCountries' => true
  )
)


$this->soap_client->getCountries(
      'companyCode' => $this->login,
      'allCountries' => true
)    

但我似乎不符合规范,因为我收到“[服务器无法处理请求。---> 对象引用未设置为对象的实例.]"

SoapClient::__getLastRequest 的最终请求是:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.jimpisoft.pt/Rentway_Reservations_WS/getCountries">
<SOAP-ENV:Body>
<ns1:getCountries/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

编辑,解决方案

$data = array(
                'getCountries' => array(
                    'objRequest' => array(
                        'companyCode' => $this->login,
                        'allCountries' => true
                    )
                )
            );
$result = @$this->_client->__call('getCountries',$data);

wich parameters are needed and in which structured way:

您可以使用 soapUI-tool 生成有效的 soap-request 和响应。

我建议将您的 soap-request(通过记录)与 soapUI 生成的进行比较:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:get="http://www.jimpisoft.pt/Rentway_Reservations_WS/getCountries">
   <soap:Header/>
   <soap:Body>
      <get:getCountries>
         <!--Optional:-->
         <get:objRequest>
            <!--Optional:-->
            <get:companyCode>?</get:companyCode>
            <get:allCountries>?</get:allCountries>
         </get:objRequest>
      </get:getCountries>
   </soap:Body>
</soap:Envelope>