1 Reply Latest reply on Aug 9, 2010 9:47 PM by Balakrishnan V



      Fellow devs,


      I'm trying to call a web service by passing a SOAP parameter/header to the method, using the following code:

      import mx.rpc.soap.*;

      import mx.core.*;

      import mx.rpc.events.*;

      import fl.data.DataProvider;

      import com.adobe.crypto.WSSEUsernameToken;

      var myWebService = new WebService();


      ("header3", "http://www.w3.org/2001/XMLSchema", "symbol","MSFT");

      myWebService.addEventListener("load", loadDone);



      var myOperation:Operation;

      function loadDone(evt:LoadEvent)


      myOperation = Operation(myWebService.getOperation("GetQuote"));

      myOperation.addEventListener("fault", wsError);

      myOperation.addEventListener("result", wsResult);



      function wsError(evt:FaultEvent)




      function wsResult(evt:ResultEvent)


      var xml:XML = XML(evt.result);

      Test.text = xml.toString();



      If I just run that code without dealing with parameter/header (see commented out line), it runs fine.  But when I try to pass in a parameter via addsimpleheader, it always returns "exception".  The web service country.asmx returns all countries; it doesn't need any parameters.  That's the one that works fine, without the addsimpleHeader.  But stockquote.asmx requires you to pass in a parameter, which is why I'm trying to get addsimpleHeader to work.


      Any suggestions?