6 Replies Latest reply on Aug 10, 2007 9:14 AM by Dr._Goomba

    HTTPS POST and useProxy=false error

    Dr._Goomba Level 1
      I am trying send an HTTPS POST to amazon, but doing so i keep receiving the following error:

      Fault: [FaultEvent fault=[RPC Fault faultString="A URL must be specified with useProxy set to false." faultCode="Client.URLRequired" faultDetail="null"] messageId=null type="fault" bubbles=false cancelable=true eventPhase=2]

      I have useProxy set to false, perhaps i've overlooked something else? This is an AIR application. Thanks!
        • 1. Re: HTTPS POST and useProxy=false error
          Ivascu Cristian Level 1

          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,
          • 2. Re: HTTPS POST and useProxy=false error
            Dr._Goomba Level 1
            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.

            • 3. Re: HTTPS POST and useProxy=false error
              Dr._Goomba Level 1
              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:

              POST https://secure.amazon.com/exec/panama/seller-admin/manual-reports/get-report-status
              Authorization: Basic base64EncodedEmailPasswordString==
              Content-Type: text/xml
              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
              NumberOfReports: 10
              ReportName: OpenListingsLite

              And the response:
              HTTP/1.1 202 Accepted
              Connection: close
              Date: Sun, 24 Oct 2004 22:42:36 GMT
              Server: Apache
              Content-Length: 1080
              Content-Type: text/xml

              <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>

              • 4. Re: HTTPS POST and useProxy=false error
                Dr._Goomba Level 1
                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.

                • 5. Re: HTTPS POST and useProxy=false error
                  Ivascu Cristian Level 1

                  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.

                  • 6. HTTPS POST and useProxy=false error
                    Dr._Goomba Level 1
                    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???