发送信息从Netsuite到Magento Api [英] Send info from Netsuite to Magento Api
问题描述
我正在尝试通过Magento API将信息从Netsuite发送到Magento.在正常情况下,我执行
I am trying to send info from Netsuite to Magento, via Magento API. In a normal condition, I execute
$user = 'user';
$pass = 'password';
$url = 'http://example.hosting.com/magento/api/soap/?wsdl';
$webClient = new SoapClient($url);
$webSession = $webClient->login($user, $pass);
$result = $webClient->call($webSession, 'ApiMethod', 'data');
购买我不理解如何在Netsuite脚本中进行制作.我找到了一种方法nlapiRequestURL,但是我不明白如何进行登录并发送会话.
Buy I don´t undestand how make it in a Script of Netsuite. I found a method nlapiRequestURL, but I don´t understand how make the login and send the session.
谢谢.
推荐答案
如果您打算在NetSuite中托管代码以与Magento进行通信,则最好使用Magento的 Javascript SOAP客户端,它不是NetSuite的一部分,而且不太可能在那种环境下正常工作.
If you are planning on hosting code within NetSuite to talk to Magento, you'd probably be better served using Magento's REST API since it will be much easier to use. Otherwise you'd need a Javascript SOAP client, which isn't part of NetSuite and unlikely to work correctly in that environment.
使用REST API,您基本上可以为每种记录类型(例如,
With the REST API, you basically hit different endpoints for each type of record e.g.
- http://magentohost/api/rest/orders for Sales Orders
- http://magentohost/api/rest/stockitems for inventory items
然后您解析响应以获取所需的数据,或发布要创建的数据.
Then you parse your response for the data you need, or post the data you want to create.
这篇关于发送信息从Netsuite到Magento Api的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!