You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.
I am using this nodejs-ebay-api module for searching the book using ISBN in app. So I took reference of this findItemsByProduct from eBay developers site. I have tried my code like following
var parameters = {
productId:{ '__value__': "9788172234980", '@type': 'ISBN' },
outputSelector: ['AspectHistogram'],
paginationInput: {
entriesPerPage: 10
}
};
ebay.xmlRequest({
serviceName: 'Finding',
opType: 'findItemsByProduct',
appId: 'My-app-id',
params: parameters
}, function itemsCallback(error, itemsResponse) {
if (error) throw error;
var items = itemsResponse.searchResult.item;
console.log('Found', items.length, 'items');
//console.log(items[0].sellingStatus.currentPrice.amount);
for (var i = 0; i < items.length; i++) {
console.log(items[i].title);
}
});
But getting error as
EbayClientError: Bad response status code 500 <?xml version='1.0' encoding='UTF-8'?><errorMessage xmlns="http://www.ebay.com/marketplace/search/v1/services"><error><errorId>5014</errorId><domain>CoreRuntime</domain><severity>Error</severity><category>System</category><message>Error reading from XML stream: Unexpected character '@' (code 64) in content after '<' (malformed start element?).
at javax.xml.stream.SerializableLocation@a550a55</message><subdomain>Comm_Recv</subdomain><parameter name="Param1">Unexpected character '@' (code 64) in content after '<' (malformed start element?).
at javax.xml.stream.SerializableLocation@a550a55</parameter></error></errorMessage>
at Request._callback (/home/user/node_modules/ebay-api/lib/xml-request.js:151:23)
at Request.self.callback (/home/user/node_modules/request/request.js:200:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/home/user/node_modules/request/request.js:1067:10)
at emitOne (events.js:101:20)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (/home/user/node_modules/request/request.js:988:12)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
Please suggest me on this.
The text was updated successfully, but these errors were encountered:
To add the attribute <productId type="ReferenceID">53039031</productId>
with the xml module which ebay-api use, you should take a different approach while building the xml.
It's easy to add.
You can edit buildXmlInput(options) function in xml-request.js. if (options.serviceName === 'Finding') { root.push({'_attr': {'xmlns': 'http://www.ebay.com/marketplace/search/v1/services'}}); /////////////////Added code to support find items by product/////////////////////////////// if(options.opType=== 'findItemsByProduct'){ root.push({'productId': [{ '_attr': { 'type': 'ReferenceID'}}, options.productId]}); } ////////////////////End added code//////////////////////////////////////// }
You should also add a productId field in the options Object of course.
Hello Dev,
I am using this nodejs-ebay-api module for searching the book using ISBN in app. So I took reference of this findItemsByProduct from eBay developers site. I have tried my code like following
But getting error as
Please suggest me on this.
The text was updated successfully, but these errors were encountered: