
TUTORIALS POINT
Simply Easy Learning Page 93
<items>
<item name="Book" description="History of France"></item>
<item name="Pen" description="Parker Pen"></item>
<item name="Pencil" description="Stationary"></item>
<items>
HTTPService Declaration
Now declare a HTTPService and pass it url of the above file
<fx:Declarations>
<mx:HTTPService id="itemRequest"
url="http://www.tutorialspoint.com/flex/Items.xml" />
</fx:Declarations>
RPC Call
Make a call to itemRequest.send() method and bind values from lastResult object of itemRequest webservice to
Flex UI component.
...
itemRequest.send();
...
<mx:DataGrid id="dgItems" height="80%" width="75%"
dataProvider="{itemRequest.lastResult.items.item}">
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="name"/>
<mx:DataGridColumn headerText="Description" dataField="description"/>
</mx:columns>
</mx:DataGrid>
RPC Service Call Example
Now Let us follow the following steps to test RPC services in a Flex application:
Create a project with a name HelloWorld under a package com.tutorialspoint.client as explained in
the Flex - Create Application chapter.
Modify HelloWorld.mxml as explained below. Keep rest of the files unchanged.
Compile and run the application to make sure business logic is working as per the requirements.
Following is the content of the modified mxml file src/com.tutorialspoint/HelloWorld.mxml.
<?xml version="1.0" encoding="utf-8"?>
Kommentare zu diesen Handbüchern