Open loricelli opened 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,
Can you paste your original JSON input?
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
Could you please fix the problem?any time I add a new npm module i have to change those values by myself.
var xmlBody contains a xml request with a wrong syntax. The ItemId it's wrong. The correct identificator is ItemID.