php - Amazon MWS SubmitFeed error: Keys may not contain < -


i'm having problems submitting feed amazon mws. keep receiving following error: "invalid query string provided - keys may not contain <"

this code:

$apicall = $this->build_url($function, $params); $ch = curl_init($apicall); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlinfo_header_out, true);  if ($this->xml) {     curl_setopt($ch, curlopt_post, true);     curl_setopt($ch, curlopt_postfields, (string)$this->xml);     curl_setopt($ch, curlopt_httpheader, array("content-type: text/xml"));     curl_setopt($ch, curlopt_httpheader, array("content-md5: " . base64_encode(md5($this->xml)))); } else {     curl_setopt($ch, curlopt_httpheader, array('content-type: text/xml')); } curl_setopt($ch, curlopt_ssl_verifypeer, true); $response = curl_exec($ch); $info = print_r(curl_getinfo($ch), true); curl_close($ch); 

$apicall formed on-the-fly , comes in form:

https://mws.amazonservices.com/feeds/2009-01-01?asinlist.asin.1=b00c5xbaoa&awsaccesskeyid=***&action=submitfeed&feedtype=_post_product_pricing_data_&mwsauthtoken=***&sellerid=***&signaturemethod=hmacsha256&signatureversion=2&timestamp=2015-06-09t09%3a58%3a01.000z&version=2009-01-01&signature=*** 

(which works fine other calls reports or orders)

$this->xml kept "text" field in mysql db; sample xml (i added lines make readable):

<?xml version="1.0"?> <amazonenvelope xsi="http://www.w3.org/2001/xmlschema-instance" nonamespaceschemalocation="amzn-envelope.xsd">     <header>         <documentversion>1.01</documentversion>         <merchantidentifier>***</merchantidentifier>     </header>     <messagetype>price</messagetype>     <message>         <messageid>1</messageid>         <operationtype>update</operationtype>         <price>             <sku>***</sku>             <standardprice currency="usd">33.5</standardprice>         </price>     </message> </amazonenvelope> 

i seem review every single relevant link on internet , cannot find answer.

maybe can give me hint may go wrong in above code?

thanks.

found solutions myself (after digging more day):

1) content-md5 must calculated in following way:

base64_encode(md5($this->xml, **true**)); 

(thanks answer: https://sellercentral.amazon.com/forums/message.jspa?messageid=2767745)

2) passing header parameters curl must one-time operation, - headers have passed array.


Comments

Post a Comment

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

go - Idiomatic way to handle template errors in golang -