products upload mime

General ShopSite user discussion

products upload mime

Postby adrian_nye » Tue Jun 29, 2010 4:36 pm

I am trying to upload inventory to shopsite using the Products XML upload. Can anyone tell me why the following isn't working or provide an example file that works?

I send a mime file to the url:

http://mystore.com/cgi-bin/dbupload.cgi ... e=products

The mime file is:

mime: MIME-Version: 1.0
Content-ID: <5.31.32252.1057009685@server01.example.net>
Content-Type: multipart/form-data; boundary="-----------------------------ShopSiteUpload_$"
-----------------------------ShopSiteUpload_$
Content-Disposition: form-data; name="clientApp"

1
-----------------------------ShopSiteUpload_$
Content-Disposition: form-data; name="dbname"

products
-----------------------------ShopSiteUpload_$
Content-Disposition: form-data; name="uniqueName"

SKU
-----------------------------ShopSiteUpload_$
Content-Disposition: form-data; name="batchsize"

500
-----------------------------ShopSiteUpload_$
Content-Disposition: form-data; name="newRecords"

no
-----------------------------ShopSiteUpload_$
Content-Disposition: form-data; name="use_optimizer"

no
-----------------------------ShopSiteUpload_$
Content-Disposition: form-data; name="defer_linking"

no
-----------------------------ShopSiteUpload_$
Content-Disposition: form-data; name="store1.xml" filename="store1.xml"
Content-Type: text/xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE ShopSiteProducts PUBLIC "-//shopsite.com//ShopSiteProduct DTD//EN" "http://www.shopsite.com/XML/1.2/shopsiteproducts.dtd">
<ShopSiteProducts>
<Response>
<ResponseCode>1</ResponseCode>
<ResponseDescription>success</ResponseDescription>
</Response>
<Products>
<Product>
<SKU>10003</SKU>
<Name>Batman Figure</Name>
<QuantityOnHand>25</QuantityOnHand>
</Product>
<Product>
<SKU>10001</SKU>
<Name>Superman Figure</Name>
<QuantityOnHand>48</QuantityOnHand>
</Product>
</Products>
</ShopSiteProducts>
-----------------------------ShopSiteUpload_$--
adrian_nye
 
Posts: 2
Joined: Tue Jun 29, 2010 4:29 pm
Location: Austin

Postby Jim » Tue Jun 29, 2010 8:59 pm

Is your domain really server01.example.net or did you just use that for the post?

Since the cgi that loads the file is in a password protected directory are you already logged in to the store when you run the command?

Are you trying to do it through the browser or through an applications?

I haven't used the feature myself but I know there are a number of apps that have been created to use this feature.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

products upload mime

Postby adrian_nye » Wed Jun 30, 2010 10:32 am

I used that domain for the post - but I am hoping it does not have to match the real domain. The example in the shopsite doc does not include this field at all even though it is required by the MIME standard.

This mime is generated and sent by a python application which takes care of sending the authentication. I am not getting authentication errors - I am getting
one of two different messages that say the contents are invalid. But the XML is so simple it must be correct. There is likely something wrong with the MIME.

If you could refer me to anyone who might know how to make this work, I'd appreciate it.

Adrian
adrian_nye
 
Posts: 2
Joined: Tue Jun 29, 2010 4:29 pm
Location: Austin


Return to User Forum

Who is online

Users browsing this forum: No registered users and 82 guests