benbuckman / nodejs-ebay-api

[No longer maintained] eBay API Client for Node.js
MIT License
155 stars 104 forks source link

Problem with buildXmlInput #33

Open loricelli opened 8 years ago

loricelli commented 8 years ago

var xmlBody contains a xml request with a wrong syntax. The ItemId it's wrong. The correct identificator is ItemID.

loricelli commented 8 years ago

A first solution could be this one:

` var tmp= xmlBody.toString().split('ItemId');

var xmlb= tmp[0].toString()+"ItemID"+tmp[1].toString()+"ItemID"+tmp[2];

return xmlb;`

I added this 2 lines at the end of the function just to replace ItemId,

benbuckman commented 8 years ago

Can you paste your original JSON input?

loricelli commented 8 years ago
  ebay.xmlRequest({
  'serviceName': 'Shopping',
  'opType': 'GetSingleItem',
  'appId': 'my app id',      // FILL IN YOUR OWN APP KEY, GET ONE HERE: https://publisher.ebaypartnernetwork.com/PublisherToolsAPI

  params: {
    'ItemId': item_id    // FILL IN A REAL ItemID
  }
.
.

The input is correct and if you print on the console the xmlBody variable you'll see that ItemId is the problem.

I found a better solution now:

  var xmlb=xmlBody.toString().split('ItemId').join("ItemID");//split the string and replace ItemId with ItemID
loricelli commented 8 years ago

Could you please fix the problem?any time I add a new npm module i have to change those values by myself.