Esempio n. 1
0
			fs.writeFile("XMLFeedFiles/" + submitId + feedType + ".txt", xml, function(err) {
				if (err) return console.log(err);
				var sf = new mwsFeedsAPI.requests.GetFeedSubmissionResult();
				sf.params.FeedSubmissionId.value = submitId;
				client.invoke(sf, function(RESULT2){

				});			
			});
	fs.readFile(filepath, function (err, data) {
		if (err) throw err;
		var xml = xmlGeneratorFactory[feedType](data);
		var sf = new mwsFeedsAPI.requests.SubmitFeed();
		sf.params.FeedContents.value = xml;
		sf.params.FeedType.value = feedType;
		client.invoke(sf, function(RESULT) {
			console.log(JSON.stringify(RESULT));
			console.log("--------");
			var submitId = RESULT.SubmitFeedResponse.SubmitFeedResult[0].FeedSubmissionInfo[0].FeedSubmissionId[0];
			if (connected) recordResultofUploadtoAmazon(feedType, submitId);
			fs.writeFile("XMLFeedFiles/" + submitId + feedType + ".txt", xml, function(err) {
				if (err) return console.log(err);		
			});
		});
	});