English 中文(简体)
Magento WS-I compliance v2 EXT WSDL web service SOAP-ERROR: 编码:物体无 不动产
原标题:Magento WS-I compliant v2 API WSDL web service SOAP-ERROR: Encoding: object has no sessionId property
  • 时间:2012-01-15 04:52:19
  •  标签:
  • magento

I m 使用Magento v2的WWS-I合规模式网络服务

在试图列出产品时例外

SOAP-ERROR: Encoding: object has no  sessionId  property

我的守则如下:

$proxy = new SoapClient( http://127.0.0.1/Magento1620/index.php/api/v2_soap?wsdl , array( trace  => 1,  connection_timeout  => 120));

    $sessionId = $proxy->login(array(
         username  => "zzc000",
         apiKey  => "zzc000"
    ));

    $filters = array(
         sku  => array( like => zol% )
    );

    $products = $proxy->catalogProductList($sessionId, $filters);

感谢

最佳回答

WS-I Mode上,在使用AP时存在一些minor differences

  1. The result of $proxy->login() is an object. You need to extract the sessionId.
  2. When calling $proxy->catalogProductList(), you need to provide the parameters in an associative array (just like you did with $proxy->login()).

Please try this:

<?php

try {
    error_reporting(E_ALL | E_STRICT);
    ini_set( display_errors , 1);
    $proxy = new SoapClient( http://127.0.0.1/Magento1620/index.php/api/v2_soap?wsdl , array( trace  => 1,  connection_timeout  => 120));

    $session = $proxy->login(array(
         username  => "zzc000",
         apiKey  => "zzc000"
    ));
    $sessionId = $session->result;

    $filters = array(
        sku  => array( like => zol% )
    );

    $products = $proxy->catalogProductList(array("sessionId" => $sessionId, "filters" => $filters));

    echo  <h1>Result</h1> ;
    echo  <pre> ;
    var_dump($products);
    echo  </pre> ;

} catch (Exception $e) {
    echo  <h1>Error</h1> ;
    echo  <p>  . $e->getMessage() .  </p> ;
}

采用其他方法,即要求采用符合第2号《SOAP》第2号要求。

问题回答

暂无回答




相关问题
Magento addFieldToFilter allow NULLs

When using the Magento collection method addFieldToFilter is it possible to allow filtering by NULL values? I want to select all the products in a collection that have a custom attribute even if no ...

Get product link from Magento API

I am new to Magento and using their API. I need to be able to get the product url from the API call. I see that I can access the url_key and url_path, but unfortunately that s not necessarily what ...

magento extension installation

I want to install a Magento extension in WAMP, but not from the Magento connect system. How can I do this? I have the module (extension) code and I already installed the sample data in the Magento ...

Link to a specific step in onepage checkout

Is it possible to redirect the browser to nth step in the onepage checkout? If so, how would one go about doing it? I m working on a payment module and have a sort of "cancel" action that i would ...

How do I filter a collection by a YesNo type attribute?

I have a ‘featured’ attribute, which has a Yes/No select-list as the admin input. I presume that the values for Yes and No are 1 and 0, as they are for every other Yes/No list. However, if I try and ...

热门标签