The following works for me:

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
creationComplete="onCreationComplete()">
     <mx:Script>
         <![CDATA[
             import mx.controls.Alert;
             import mx.rpc.events.ResultEvent;
             import mx.rpc.events.FaultEvent;
             import mx.rpc.soap.mxml.WebService;

             private var ws:mx.rpc.soap.mxml.WebService;
             private var getMyInfoRequest:Object = new Object();

             public function onCreationComplete():void
             {
                 ws = new mx.rpc.soap.mxml.WebService();
                 ws.endpointURI = "http://myserver.com/myService.php";;
                 ws.loadWSDL("http://myserver.com/myService.wsdl";);
                 ws.addEventListener(FaultEvent.FAULT, faultHandler);
                 ws.addEventListener(ResultEvent.RESULT, resultHandler);

                 getMyInfoRequest.parameter1 = "aaa";
                 getMyInfoRequest.parameter2 = "bbb";
                 getMyInfoRequest.parameter3 = "ccc";
             }

             public function resultHandler(event:ResultEvent):void
             {
                 Alert.show((event.result as Object).myInfo);
             }
             public function faultHandler(event:FaultEvent):void
             {
                 Alert.show(event.fault.faultString);
             }

             public function runRequest():void
             {
                 ws.getMyInfo(getMyInfoRequest);
             }
         ]]>
     </mx:Script>
     <mx:Button label="RunRequest" click="runRequest()"/>
</mx:Application>

Now, I did have to update my crossdomain.xml file to:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd";>
<cross-domain-policy>
   <site-control permitted-cross-domain-policies="all">
     <allow-access-from domain="*" ports="*" />
     <allow-access-from domain="*" to-ports="*" secure="true" />
     <allow-http-request-headers-from domain="*" headers="*" />
   </site-control>
</cross-domain-policy>

Also, I had to add my bin-debug folder to the list in the Global
Security Settings Panel at:
http://www.macromedia.com/support/documentation/en/flashplayer/help/sett\
ings_manager04.html.

Perhaps you could post the WSDL and I can give it a try here.


HTH



Steve


--- In [email protected], "wkolcz" <[EMAIL PROTECTED]> wrote:
>
> I put the webservice so it creates a public instance ready for use.
>
>     public var webService:WebService = new WebService();
>     public var trackInfo:Object = new Object();
>     public var myTimer:Timer = new Timer(0);
>
> I then change the code to:
>
>     private function wsdlLoaded(event:LoadEvent):void {
>         Alert.show("Web Service Loaded and Ready", "Service Status");
>         webService.countIt(trackInfo);
>         webService.addEventListener(FaultEvent.FAULT, alertFault);
>
>     }
>
>     private function stop_onClick(event:MouseEvent):void {
>         myTimer.stop()
>         trackInfo.addOne = 1 ;
>         trackInfo.duration =  myTimer.currentCount;
>         trackInfo.action = "Video Stopped";
>         trackInfo.source = source;
>         webService.wsdl =
"https://ummciisdevweb22.umich.edu/videotracking/trackerDAO.cfc?wsdl";;
>         webService.loadWSDL();
>         webService.addEventListener(LoadEvent.LOAD, wsdlLoaded);
>         stop();
>         playPressed = false;
>     }
>
> It loads the WSDL and the Alert pops up, but still cant get it to the
database. Now I am getting:
>
> faultCode:DecodingError
> faultString:'SOAP Response cannot be decoded.
> Raw response: ' faultDetail:'null'
>
> ----------------------------------------
> From: "Tracy Spratt" [EMAIL PROTECTED]
> Sent: Monday, December 08, 2008 10:08 AM
> To: [email protected]
> Subject: RE: [flexcoders] Does anyone know ANYTHING about AS
Webservices?
>
> First, loadWSDL() is asynchronous.  You
> need to wait for the LoadEvent.LOAD event before attempting to call an
> operation.   Also, declare and use a result Handler in
> addition to the fault handler.   Tracy
> ----------------------------------------
>  From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of wkolcz
> Sent: Monday, December 08, 2008
> 12:34 PM
> To:[email protected]
> Subject: [flexcoders] Does anyone
> know ANYTHING about AS Webservices?
>
> I created
> a simple web service using ColdFusion CFC. It takes a struct and
inserts the
> info into the database. Works fine from a direct call using CF's
createObject("webservice")
> so I know it works...
>
> However in AS, I am getting this error:
>
> faultCode:DecodingError faultString:'SOAP Response cannot be decoded.
> Raw response: ' faultDetail:'null'
>
> Here is my Web Service Script:
>
> var ws:WebService = new WebService();
>
> ws.wsdl =
"https://ummciisdevweb22.umich.edu/videotracking/trackerDAO.cfc?wsdl";;
>
> ws.addEventListener(FaultEvent.FAULT, alertFault);
>
> ws.loadWSDL();
>
> ws.countIt({trackData:trackInfo});
>
> I have looked at 100 different examples and none of them work. Does
ANYONE know
> how I can get this to work? I have a Wednesday deadline to get this
thing to work.
>

Reply via email to