mws.Feeds.submit_feed() started getting 'xml.etree.ElementTree.Element' object has no attribute 'getchildren' error


#1

Can someone please help me with this?

mws.Feeds.submit_feed() had worked just fine up until two weeks ago. Now it gives me ‘xml.etree.ElementTree.Element’ error.

I have been using the credentials below:

mws.Feeds(
access_key.MWS_ACCESS_KEY,
secret_key = MWS_SECRET_KEY,
account_id& = self.SELLER_ID,
region = ‘US’)

This is my request:

<?xml version="1.0"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
  <Header>
    <DocumentVersion>1.01</DocumentVersion>
    <MerchantIdentifier>xxxxxx</MerchantIdentifier>
  </Header>
  <MessageType>Inventory</MessageType>
  <Message>
    <MessageID>1</MessageID>
    <OperationType>Update</OperationType>
    <Inventory>
      <SKU>xxxxx</SKU>
      <Quantity>0</Quantity>
    </Inventory>
  </Message>
</AmazonEnvelope>

This is my code:

def SendFeed( self, xmlRequest ):
        assert( xmlRequest != '' )
        request = xmlRequest.encode('utf-8')
        response = self.feeds_api.submit_feed(
            request,
            '_POST_INVENTORY_AVAILABILITY_DATA_',
            self.MARKETPLACES
        )
        return response

I have created an App in my Developer central.


Thank you!

#2

Found the problem. I just needed to update mws.


#3

Hi AutoShopping24,

I am also getting this error with mws reports api, using the same lib (amazon-mws?), stuff was working now it isnt, I’m curious what version you upgraded from, and to? I’m using the latest version of the lib and I still get this error.

Thanks,

Jack


#4

Hi Jack,

I followed instructions on https://github.com/python-amazon-mws/python-amazon-mws.

I had to remove the module and reinstall it using pip install git+https://github.com/python-amazon-mws/python-amazon-mws.git@master#egg=mws.

Cheers,