1 Reply Latest reply on Jan 29, 2009 10:26 PM by hskumar

    Sending SOAPRequest in HttpService

    hskumar
      Hi,
      I am trying to call a HttpService in ActionScript. Here is my code snippet,
      var parameters:Object = {};
      parameters["SOAPRequest"]="<![CDATA[<SOAPRequest><Execute xmlns='urn:schemas-microsoft-com:xml-analysis'><Command><Statement>WITH MEMBER Measures.SPEED_RANGE1 AS 'AGGREGATE({[DRIVING_SPEED].[102]:[DRIVING_SPEED].[124]})' MEMBER Measures.SPEED_RANGE2 AS 'AGGREGATE({[DRIVING_SPEED].[125]:[DRIVING_SPEED].[135]})' MEMBER Measures.SPEED_RANGE3 AS 'AGGREGATE({[DRIVING_SPEED].[136]:[DRIVING_SPEED].[212]})' select {Measures.SPEED_RANGE1,Measures.SPEED_RANGE2,Measures.SPEED_RANGE3} ON COLUMNS, {[TIME].[2008].[9].[1],[TIME].[2008].[9].[2],[TIME].[2008].[9].[3],[TIME].[2008].[9].[4], [TIME].[2008].[9].[5]} on ROWS FROM SPEED WHERE [CLIENTS].[ExpTestJay]</Statement></Command></Execute>]</SOAPRequest>]>";

      service = new HTTPService();
      service.url = "10.40.13.154";
      service.method = "POST";
      service.addEventListener(ResultEvent.RESULT, httpResult);
      service.addEventListener(FaultEvent.FAULT, httpFault);
      service.send(parameters);

      I am getting this error,
      HTTP request error->Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032"]. URL: 10.40.13.154


      I was able to successfully do it through the <mx:HttpService>
      <mx:HTTPService id="httpService" url=" http://10.40.13.154:8080/mondrian/xmla.jsp"
      method="POST" result="displayData(event)" resultFormat="e4x">

      <mx:request>
      <SOAPRequest>
      {query}
      </SOAPRequest>
      </mx:request>
      </mx:HTTPService>

      I am just wondering what am I missing when I call the HttpService through the action script ?

      Any sample of how to send a SOAPRequest in a HttpService call using ActionScript will be appreciated.
        • 1. Re: Sending SOAPRequest in HttpService
          hskumar Level 1
          I figured out the issue of why the service is not called. Basically the url needs to be the address of the jsp that process the request wherein in the above snippet it was just the URL

          Now I am getting a different error stating that the SOAPRequest request parameter value is invalid.

          Basically the value is taken as a String object address like below,

          [STDOUT] Parameter =SOAPRequest Value = [Ljava.lang.String;@7d6a33

          how can I pass the SOAPRequest correctly?