подключение к удаленному веб-сервису с использованием SOAP и WSDL с использованием flex или actionscript - PullRequest
0 голосов
/ 16 августа 2011

Требуется получить метод с именем getIncidentList () из веб-службы, используя Soap, и wsdl, используя Flex или Actionscript.Может кто-нибудь помочь мне, у меня есть код, который не работает:

      <?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 mx.rpc.events.ResultEvent;
            import mx.rpc.events.FaultEvent;
            import mx.utils.ObjectUtil;
            import mx.collections.ArrayCollection;

            [Bindable] private var zipfls:ArrayCollection;
            private var flag:Boolean;

        private function button_click():void 
        {
            //Alert.show("Hi");
            //DirectoryService.GetIncidentList.send();
            DirectoryService.GetIncidentList();
            flag = DirectoryService.canLoadWSDL();
            //flag = DirectoryService.hasOwnProperty();
            //Alert.show("Testing....." + flag);
            //Alert.show("Description " +DirectoryService.operations);

            } 

             private function onResult(evt:ResultEvent):void 
            {
            zipfls = new ArrayCollection();                 
            //textArea.text = ObjectUtil.toString(evt.result);
            zipfls = evt.result as ArrayCollection;
            Alert.show("Is data comming in?" + zipfls.length);
            }

            private function onFault(evt:FaultEvent):void 
            {
            Alert.show(evt.type);

            }


           ]]>
        </mx:Script>

 </mx:Application>

1 Ответ

0 голосов
/ 17 августа 2011

Я думаю, что вы не вызываете метод правильно

и событие button_click должно быть

    private function button_click():void 
    {
        DirectoryService.GetIncidentList();

    }  

т.е. отправить не следует использовать.

также см. Использование компонентов WebService

Надежды, которые помогают

...