jaxb - Processing Amazon MWS Feed Responses -
we set system processing amazon feeds variety of customers. working lot of customers , process feeds this:
<amazonenvelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nonamespaceschemalocation="amzn-envelope.xsd"> <header> <documentversion>1.02</documentversion> <merchantidentifier>redacted_8055</merchantidentifier> </header> <messagetype>processingreport</messagetype> <message> <messageid>1</messageid> <processingreport> <documenttransactionid>1016539</documenttransactionid> <statuscode>complete</statuscode> <processingsummary> <messagesprocessed>218</messagesprocessed> <messagessuccessful>218</messagessuccessful> <messageswitherror>0</messageswitherror> <messageswithwarning>0</messageswithwarning> </processingsummary> </processingreport> </message> </amazonenvelope>
however, 1 customer getting feed response this:
<amazonenvelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nonamespaceschemalocation="amzn-envelope.xsd"> <header> <documentversion>3.00</documentversion> <merchantidentifier>redacted_43183</merchantidentifier> </header> <messagetype>processingreport</messagetype> <message> <messageid>1</messageid> <processingreport> <processingreporttype>inventory</processingreporttype> <documenttransactionid>10460738</documenttransactionid> <summary marketplacename="all"> <statuscode>complete</statuscode> <processingsummary> <messagesprocessed>1</messagesprocessed> <messagessuccessful>1</messagessuccessful> <messageswitherror>0</messageswitherror> <messageswithwarning>0</messageswithwarning> </processingsummary> </summary> </processingreport> </message> </amazonenvelope>
which not unsuccessfully unmarshal. note subtle differences: documentversion different, , processingsummary embedded inside of summary tag schema not expecting. latter kills jaxb unmarshalling process. can't find documentation on why happens , hoping here had come across before.
i can't tell jaxb ignore unknown elements because need processingsummary , it's buried under strange "summary" tag.
does know why 1 customer 1 type of feed response , different one?
i know isn't of answer, based on little i've had chance work through of marketplaces -- china -- behave little differently different requests, in might have different capabilities or required information. following link may point in better direction:
http://docs.developer.amazonservices.com/en_us/feeds/feeds_overview.html#feeds_eu_global_seller
i agree it's strange same request yield different results. i've used .net client library feeds far, not manually parsing xml, did have problem error deserialization when submitting wrong service url. after looking through sourcecode (link above) noticed they're using 2 variants of regex matching try grab error code/message after failing deserialize "expected" errorresponse object. turns out because accidentally making requests orders endpoint (rather feeds endpoint), error xml subtly different , didn't match regex, , wasn't getting useful error message back.
i mention because:
- what marketplace getting different results? sending wrong endpoint?
- maybe fallback using jaxb use regex or xpath or string-matching grab relevant section.
Comments
Post a Comment