来电Magento的SOAP API立即过期 [英] call to magento soap api expires immediately

查看:195
本文介绍了来电Magento的SOAP API立即过期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做Magento的API的调用来获得特定客户的详细信息。当我做这个电话,我总是得到以下错误:

I'm trying to do a call to the magento api to get the details of a specific customer. When I do this call I always get the following error:

PHP Fatal error:  Uncaught SoapFault exception: [5] Session expired. Try to relogin. in     /var/www/magento-client/magento-customer.php:12
Stack trace:
/var/www/magento-client/magento-customer.php(12): SoapClient->__call('call', Array)
/var/www/magento-client/magento-customer.php(12): SoapClient->call('a1a6863c7dadd95...', 'customer.info', 3)
{main}
  thrown in /var/www/magento-client/magento-customer.php on line 12

我在后台有效的API的用户,在后端的API会话超时设置为9999999999999,我甚至一直试图重写Magento的核心code中的isSessionExpired功能,但没有任何工程。

I have a valid api user in the backend, the api session timeout in the backend is set to 9999999999999, and I've even tried to override the isSessionExpired function in the magento core code, but nothing works.

在code是如下:

$url = 'http://magentourl/api/soap/?wsdl';
$apiUser = "user";
$apiPass = "password";

$proxy = new SoapClient($url);

$sessionId = $proxy->login($apiUser, $apiPass);

// Get new customer info
var_dump($sessionId);
var_dump($proxy->call($sessionId, 'customer.info', 3));
die();

有没有人有任何想法,问题可能是什么?

Does anyone have any ideas what the problem could be?

推荐答案

如果您发送标题与要求,检查头被发送,就会出现此。

This occurs if you send headers with the request, check if headers are sent.

这篇关于来电Magento的SOAP API立即过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆