question

autoshopping24.club avatar image
0 Likes"
autoshopping24.club asked ·

Error When Making LMS Upload File Request

Hello, I've been trying to upload inventory update file using FileTransfer service but it doesn't work. My Python request sample is below. The error I am getting is Unable to create xml stream reader for XML: payload format incorrect or payload is empty I suspect there is a bug in the way I created my request. Can someone help troubleshooting it? Thank you,
lms-uploadfile-error
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

autoshopping24.club avatar image
0 Likes"
autoshopping24.club answered ·
with open( 'ReviseInventoryStatus.xml', 'rb' ) as f_in: with gzip.open('ReviseInventoryStatus.xml.gz', 'wb') as f_out: shutil.copyfileobj( f_in, f_out ) data = gzip.open( 'ReviseInventoryStatus.xml.gz', "rb" ).read() b64data = base64.b64encode( data ) url = " https://storage.ebay.com/FileTransferService"; headers = {"X-EBAY-SOA-SECURITY-TOKEN": '', "X-EBAY-SOA-SERVICE-NAME": "FileTransferService", #"X-EBAY-SOA-SERVICE-VERSION": "1.0.0", "X-EBAY-SOA-OPERATION-NAME": "uploadFile", } #Form the request string uploadFileRequest = """<?xml version="1.0" encoding="UTF-8"?> <uploadFileRequest xmlns=" http://www.ebay.com/marketplace/services">; <taskReferenceId>""" + taskReferenceId + """</taskReferenceId> <fileReferenceId>""" + fileReferenceId + """</fileReferenceId> <fileFormat>""" + fileType + """</fileFormat> <fileAttachment> <Data>""" + str ( b64data ) + \ """</Data> </fileAttachment> </uploadFileRequest>""" files = { 'data' : uploadFileRequest, 'file': open('ReviseInventoryStatus.xml.gz', 'rb') } #'file': open('ReviseInventorybase64New.bin', 'rb') #'file': ( 'ReviseInventoryStatus.zip', b64data, 'application/octet-stream\r\nContent-Transfer-Encoding: base64') return requests.put( url = url, files = files, headers = headers )
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

autoshopping24.club avatar image
0 Likes"
autoshopping24.club answered ·
Hi @eram_developersupport , Unfortunately Premium Support were not able to help I rewrote my code and the issue I am experiencing now is that I can't attach gzip file encoded in binary 64 to the POST request. Please see code below. Would you be able to help ?
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

eram_developersupport avatar image
0 Likes"
eram_developersupport answered ·
Hi @autoshopping24.club, You are most welcome. Feel free to contact us for any further query. Best Regards, eBay Developer Support.
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

autoshopping24.club avatar image
0 Likes"
autoshopping24.club answered ·
Ok, thank you!
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

eram_developersupport avatar image
0 Likes"
eram_developersupport answered ·
Hi @ autoshopping24.club , For this you have to file a support Ticket which is one time payable ,after that you can file a support for any further bug without any pay. REF: [Premium Support][1] Best Regards, eBay Developer Support [1]: https://developer.ebay.com/my/support/tickets
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.