r2 - 10 May 2007 - 14:40:28 - FredOliveiraYou are here: GoplanWiki >  Developers Web > FlexExample

Introduction

The source code below is from a very simple application that retrieves a Task list and a Ticket list from goplan. It suffices to show how easy it is to consume the Goplan SOAP API to build Rich Internet Applications using tools like Adobe's Flex. If you want to try this example on your own take the following steps:

Trying it yourself

  • Create a new Flex Project
    • File -> New -> Flex Project
  • Name it whatever you like
  • Inside the project, create a new MXML Application
  • Inside the application, switch to the Source view and paste the code below
  • Make sure you change the auth parameters in the mx:request calls, as well as WSDL endpoint to the proper location
  • Build the application and run it!

Source Code

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
   <mx:WebService id="goplan" wsdl="http://goplan.org/soap_api/wsdl" useProxy="false">
      <mx:operation name="FindAllTasks">
         <mx:request xmlns="">
            <auth>
               <project>PROJECT</project>
               <token>TOKEN</token>
               <username>EMAIL</username>
               <password>PASSWORD</password>
            </auth>
         </mx:request>
      </mx:operation>
      
      <mx:operation name="FindAllTickets">
         <mx:request xmlns="">
            <auth>
               <project>PROJECT</project>
               <token>TOKEN</token>
               <username>EMAIL</username>
               <password>PASSWORD</password>
            </auth>
         </mx:request>
      </mx:operation>
   </mx:WebService>
   
   <mx:Panel y="10" height="300" layout="absolute" title="Task list" left="10" width="421">
      <mx:Button label="Get task list" click="goplan.FindAllTasks.send()" x="10" y="228"/>
      <mx:DataGrid height="210" dataProvider="{goplan.FindAllTasks.lastResult}" y="10" right="10" left="10">
         <mx:columns>
            <mx:DataGridColumn headerText="Title" dataField="title" width="300" />
            <mx:DataGridColumn headerText="Status" dataField="status" />
         </mx:columns>
      </mx:DataGrid>
   </mx:Panel>
   <mx:Panel y="10" height="300" layout="absolute" title="Ticket list" right="10" left="439">
      <mx:Button label="Get ticket list" click="goplan.FindAllTickets.send()" x="10" y="228"/>
      <mx:DataGrid height="210" dataProvider="{goplan.FindAllTickets.lastResult}" y="10" right="10" left="10">
         <mx:columns>
            <mx:DataGridColumn headerText="Title" dataField="title" />
            <mx:DataGridColumn headerText="Status" dataField="status" />
            <mx:DataGridColumn headerText="Priority" dataField="priority" />
            <mx:DataGridColumn headerText="Severity" dataField="severity" />
         </mx:columns>
      </mx:DataGrid>
   </mx:Panel>
   
</mx:Application>

WYSIWYG

goplan_flex.png

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
Goplan Wiki
Copyright © by the contributing authors. Goplan is © Webreakstuff