0 Replies Latest reply on Aug 17, 2011 8:47 AM by kanjiri

    connecting to web services using SOAP and WSDL

    kanjiri

      Hi

      following is the  code to call a method from webservices using SOAP and WSDL:

       

       

                <?xml version="1.0" encoding="utf-8"?>

                <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

                <mx:WebService id="DirectoryService"

                       wsdl="http://cmuicds.rutgers.edu/uicds/core/ws/services/DirectoryService.wsdl"

                       useProxy="false" 

                       showBusyCursor="true"

                       result="onResult(event)"

                       fault="onFault(event)">  

               </mx:WebService>

       

               <mx:ApplicationControlBar dock="true">

                   <mx:Button id="button"

                      label="get incidents from web service"

                      click="button_click()"/>

                   <mx:ComboBox id="cmb" dataProvider="{zipfls}" labelField="name" width="241" height="24"/>

               </mx:ApplicationControlBar>

               <mx:Script>

                    <![CDATA[

                           import mx.controls.Alert;

                           import flash.utils.ByteArray;

                            import mx.rpc.events.ResultEvent;

                            import mx.rpc.events.FaultEvent;

                            import mx.utils.ObjectUtil;

                            import mx.collections.ArrayCollection;

                            import mx.rpc.soap.mxml.WebService;

       

                            [Bindable] private var zipfls:ArrayCollection;

                            private var flag:Boolean;

                            //private var byte:ByteArray;

       

                           private function button_click():void

                           {

                               DirectoryService.GetIncidentList();

       

                            }

       

                             private function onResult(evt:ResultEvent):void

                             {

                                  zipfls = evt.result as ArrayCollection;

                                  Alert.show("Is data comming in? " + zipfls);

                            }

       

                             private function onFault(evt:FaultEvent):void

                             {

                                     Alert.show(evt.type);

       

                             }

       

                       ]]>

                    </mx:Script>

         

           </mx:Application>

       

      I am getting Fault event here.CAn someone help me?