I am using VB.net to make XML calls to the Amazon webservice, code snippet as
follows:
sContactURL =
"https://secure.amazon.de/exec/panama/seller-admin/catalog-upload/add-modify-delete"
' Save Login and Password - Colon (:) seperated
csUserNamePassword = "xx*@xx.co.uk:xxxxxxxxx"
'Open the a new request
Call xmlHTTP.open(bstrmethod:="POST", bstrurl:=sContactURL,
varAsync:=False)
'Set up required headers
xmlHTTP.setRequestHeader("HTTP_USER_AGENT", "Mozilla/4.0
(compatible; MSIE 5.5; Windows 98)")
xmlHTTP.setRequestHeader("Content-Type", "text/xml")
xmlHTTP.setRequestHeader("Authorization", "Basic " &
bBase64.Encode(csUserNamePassword))
xmlHTTP.setRequestHeader("dev-t", "token")
xmlHTTP.setRequestHeader("UploadFor", "Marketplace")
xmlHTTP.setRequestHeader("FileFormat", "TabDelimited")
xmlHTTP.setRequestHeader("Cookie",
"x-main=YvjPkwfntqDKun0QEmVRPcTTZDMe?Tn?;ubid-main=002-8989859-9917520;ubid-tacbus=019-5423258-4241018;x-tacbus=vtm4d53DvX@Sc9LxTnAnxsFL3DorwxJa;
ubid-tcmacb=087-8055947-0795529;ubid-ty2kacbus=161-5477122-2773524;
session-id=087-178254-5924832; session-id-time=950660664")
'Send the file as the *only* thing in the body of the message
Try
Call xmlHTTP.send(varbody:=sUploadContents)
'Get the server's response
sResponse = xmlHTTP.responseText
sResponse = Trim(sResponse)
If sResponse = "<Success>SUCCESS</Success>" Then 'It worked
mWriteMessage("Upload of " & vsFileLocation & " Was
successful")
bOK = True
Else
mWriteMessage("Upload of " & vsFileLocation & " Failed" &
sResponse)
'MsgBox("Error Uploading to Amazon")
bOK = False
End If
Catch err As Exception ' Error has occured in the call
mWriteMessage("Upload Call has failed : Run Number " &
Parameters.RunNumber)
bOK = False
End Try
sUploadContents is the text from a file which can be anything between a few
hundred and a few thousand KB in size.
When running in debug, the upload happens perfectly, taking beween a few,
and a few tens of seconds depending on the size of file.
However, when running from the executable on the same machine, it gets to
the line:
Call xmlHTTP.send(varbody:=sUploadContents)
and hangs. I have left it alone for 3-4 hours, yet it never completes.
Anyone got any ideas??
Gambo