
210 Use Web Services
10. Switch to Source mode.
The Services.mxml file should contain the following MXML code (your coordinate values
may vary):
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Panel x="10" y="10" width="475" height="400" layout="absolute"
title="Most Popular Posts">
<mx:ComboBox x="30" y="25" id="cbxNumPosts">
<mx:Object label="Top 5" data="5" />
<mx:Object label="Top 10" data="10" />
<mx:Object label="Top 15" data="15" />
</mx:ComboBox>
<mx:DataGrid x="30" y="75" id="dgTopPosts" width="400">
<mx:columns>
<mx:DataGridColumn headerText="Column 1"
dataField="col1"/>
<mx:DataGridColumn headerText="Column 2"
dataField="col2"/>
<mx:DataGridColumn headerText="Column 3"
dataField="col3"/>
</mx:columns>
</mx:DataGrid>
<mx:LinkButton x="30" y="250"
label="Select an item and click here for full post"/>
</mx:Panel>
</mx:Application>
The next step is to insert and configure an RPC component called WebService in your
application.
Insert a WebService component
You use the Flex WebService component to access a SOAP-based web service and retrieve
information about recent blog posts.
1. In Source mode, enter the following <mx:WebService> tag immediately after the opening
<mx:Application> tag:
<mx:WebService id="wsBlogAggr"
wsdl="http://weblogs.macromedia.com/mxna/webservices/mxna2.cfc?wsdl"
useProxy="false">
</mx:WebService>
Kommentare zu diesen Handbüchern