This content has been marked as final. Show 6 replies
You should put the url on the "theRequesst" variable that represents the HTTPService that gets sent like this:
theRequest.url = "https://secure.amazon.com/exec/panama/seller-admin/manual-reports/get-report-status";
From the code sample it seems that youare trying to use two separate entities: an URLRequest and an HTTPService. If you want to make the request via the HTTPService class you must set all the connection required attribute on its instance - like url, headers, etc.
The send() method only takes as argument the object with parameters that will be sent via the POST - not connection headers.
Furthermore, if the url you are trying to connect to has basic authentication, you can use the setCredentials() method on the HTTPService instance to set the username and password and not set them in the headers after all.
Hope this helps,
Ok, i have simplified it and did as u suggest, however now i get an error stating "Authentication not supported on DirectHTTPChannel (no proxy)" but im sorry i don't know what this means.
I cannot figure out what is going on. Here is another bit of code i have tried, but this time i am getting the following error:
Fault: [FaultEvent fault=[RPC Fault faultString="Error #1090: XML parser failure: element is malformed." faultCode="Client.CouldNotDecode" faultDetail="null"] messageId="113D6D39-26C2-A53D-AFF1-290141AEED38" type="fault" bubbles=false cancelable=true eventPhase=2]
If you were to go straight to the url https://secure.amazon.com/exec/panama/seller-admin/manual-reports/generate-report-now and login it will output <Status>SUCCESS</Status>. I'm not even able to successfully get that returned!
Here is what Amazon shows as an example of a query API:
Authorization: Basic base64EncodedEmailPasswordString==
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-
And the response:
HTTP/1.1 202 Accepted
Date: Sun, 24 Oct 2004 22:42:36 GMT
<Report>reportstarttime=10-18-2004:10-50-56 reportendtime=10-18-2004:10-50-56 reportid=12345456 </Report>
<Report>reportstarttime=10-11-2004:15-02-21 reportendtime=10-11-2004:15-02-21 reportid=23664721 </Report>
Ok check this out now. I am thinking there is a bug in URLRequest or URLRequestHeaders as my the Authorization header is not being recognized by Amazon (all that gets returned is the html code for the login page, when it should be XML Success or Failure based on my login). I can do this in cURL and it works fine, but not in actionscript.
I don't get it. Please try it out yourself.
Did you manage to get it to work? I am trying to figure out what is happening, but I cannot seem to find some information on this particular service. Is it an HTTP service (REST) or a WEB service (WSDL-SOAP). If it is the last option you will have to use a special encoder / decoder to encode the request and decode the response.
Please post a link to the API documentation so that I can get a better understanding and help out with the problem.
Actually there was something else that is causing a problem. When you pass the case sensitive headers, Flex3 converts them to all lower case after the first letter. Such as URLRequestHeader("ReportName", "OpenListingsLite") converts to URLRequestHeader("Reportname", "OpenListingsLite"). Because of this bug, i can't pass named headers. Can you fix this???