Send info from Netsuite to Magento Api

蹲街弑〆低调 提交于 2019-12-25 06:31:56

问题


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');

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.

Thanks.


回答1:


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.

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.



来源:https://stackoverflow.com/questions/38356050/send-info-from-netsuite-to-magento-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!