1 Reply Latest reply on May 15, 2007 12:33 PM by ashar2005

    Sending XML over HTTPS

    RekhaPatel
      I am trying to send an XML request over HTTP and set the HTTP headers as follows:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="gsrRPC.send()">

      <mx:Script>
      <![CDATA[
      import mx.collections.ArrayCollection;
      import mx.rpc.events.ResultEvent;
      import flash.utils.*;

      [Bindable]
      private var headers:Object = {"X-EBAY-API-COMPATIBILITY-LEVEL" : "511",
      "X-EBAY-API-SITEID": "0",
      "X-EBAY-API-CALL-NAME": "GetSearchResults",
      "Content-Type": "text/xml"};

      private function resultHandler(event:ResultEvent):void {
      trace(event.result);
      }

      ]]>
      </mx:Script>
      <mx:HTTPService id="gsrRPC" url="https://api.ebay.com/ws/api.dll" result="resultHandler(event)" headers="{headers}">
      <mx:request>
      <GetSearchResultsRequest xmlns="urn:ebay:apis:eBLBaseComponents">
      <Version>505</Version>
      <Query>test</Query>
      <RequesterCredentials>
      <eBayAuthToken>*****</eBayAuthToken>
      </RequesterCredentials>
      </GetSearchResultsRequest>
      </mx:request>
      </mx:HTTPService>
      </mx:Application>

      When I run the application, I get the following error message:

      Main Thread (Suspended: [RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: https://api.ebay.com/ws/api.dll?GetSearchResultsRequest=%5Bobject%20Object%5D"]. URL: https://api.ebay.com/ws/api.dll"])
      mx.rpc.http.mxml::HTTPService/ http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent
      mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::faultHandler
      mx.rpc::Responder/fault
      mx.rpc::AsyncRequest/fault
      DirectHTTPChannel.as$139::DirectHTTPMessageResponder/errorHandler
      flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction [no source]
      flash.events::EventDispatcher/dispatchEvent [no source]
      flash.net::URLLoader/flash.net:URLLoader::redirectEvent [no source]

      Can I send an XML request over HTTPS using HTTPService? If so, what is causing this error?
        • 1. Re: Sending XML over HTTPS
          ashar2005
          Access your own application using https and you won't have a problem.

          If you access your page using http and your application makes
          a call to https ... it will trigger security checks in which case you would have
          to have one of many things, i.e. crossdomain.xml on the server.... allowDomain, etc