0 Replies Latest reply on Feb 1, 2007 9:33 AM by boiiing

    Accessing the SOAPMessage

    boiiing
      Hi everyone,

      I am having issues while trying to retrieve the SOAPMessage from the response to a webservice call in order to gain access to the headers and would be grateful if someone was able to point me in the right direction.

      I am using Cairngorm to retrieve a webservice using a ServiceLocator which then has a listener Method registered against so that it is called when a result is returned. I am trying to get a SOAPMessage out of the ResultEvent that contains the webservice response so that I can retrieve the header but am having difficulty. I have pasted the code I have been working with below.

      Please help


      public function login():void{

      var service:WebService = ServiceLocator.getInstance().getService("myService") as WebService;
      service.addEventListener(ResultEvent.RESULT, loginService_onResult);

      service.login();

      }


      private function loginService_onResult( event:ResultEvent ): void {
      trace("got onResult");

      var mes:AcknowledgeMessage = event.message as AcknowledgeMessage;
      var str:String = mes.toString();
      var messs:String = mes.body as String;

      var xml:XML = new XML(mes.body);

      responder.onResult(event);
      }