Skip to content

Always getting null #37

Description

@tur-ing

I am trying to access a Magento SOAP API (v 1.9.2.4) using npm magento. But data is always null:

var express = require('express');
var app = express();
var MagentoAPI = require('magento');
var magento = new MagentoAPI({
  host: 'localhost',
  port: 8080,
  path: '/magento/api/xmlrpc/',
  login: 'mothership',
  pass: 'bvZ0k0B02pTjujN'
});

app.get('/', function (req, res) {
  res.send('Customers: ');
});

var magentoCallback = function(data) {
  console.log('Got data: ' + data);
  console.log(data);
};

magento.login(function(err, sessId) {
  if (err) {
    console.log("Error accessing Magento");
    console.log(err);
    console.log("Session ID: " + sessId);
    return;
  }
  console.log("Connected to Magento");
  magento.core.info(magentoCallback);
});

app.listen(3000, function () {
  console.log('Racing on port 3000');
});

enter image description here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions