2 Replies Latest reply on May 18, 2007 4:52 PM by skeeeter144

    Web Services?

      Can someone PLEASE give me an example of how to use an XMLRPC web service in FLEX2?
        • 1. Re: Web Services?
          Rahul Mainkar Level 1
          <?xml version="1.0"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" verticalGap="10">
          import mx.controls.Alert;
          <mx:WebService id="employeeWS"
          fault="Alert.show(event.fault.faultstring, 'Error');">
          <mx:operation name="getList" resultFormat="e4x">
          <mx:Label text="Select a department:"/>
          <mx:ComboBox id="dept" width="150">
          <mx:Object label="Engineering" data="ENG"/>
          <mx:Object label="Product Management" data="PM"/>
          <mx:Object label="Marketing" data="MKT"/>
          <mx:Button label="Get Employee List"
          <mx:XMLListCollection id="xc"
          <mx:DataGrid dataProvider="{xc}" width="100%">
          <mx:DataGridColumn dataField="name" headerText="Name"/>
          <mx:DataGridColumn dataField="phone" headerText="Phone"/>
          <mx:DataGridColumn dataField="email" headerText="Email"/>

          This ex. is from flex2 devguide page 1155
          Hope this helps you.
          • 2. Re: Web Services?
            skeeeter144 Level 1
            Thanks for the snippet! I might be missing something, but I don't think that's what I'm trying to do??

            Here's an example of how to do what I want in python:
            ------------------------------------------------------------------------------------------ --------------------

            from xmlrpclib import *
            FOO_Login = 'login'
            FOO_Password = 'pass'

            Server_URL = " http://xmlrpc.foobar.com/xmlrpc/Food"
            Auth_URL = " http://xmlrpc.foobar.com/xmlrpc/Authenticate"

            auth_server = ServerProxy(Auth_URL)
            token = auth_server.systemLogin(FOO_Login, FOO_Password)
            server = ServerProxy(Server_URL + "/::session_id::" + token)

            food = server.getFoodList()
            print "Food: %s" % food

            ------------------------------------------------------------------------------------------ --------------------

            Does anyone have any idea? :D