Remote-procedure-call (RPC) services let your application interact with remote servers to provide data to your applications, or for your application to send data to a server.
Flex is designed to interact with several types of RPC services that provide access to local and remote server-side logic. For example, a Flex application can connect to a web service that uses the Simple Object Access Protocol (SOAP), a Java object residing on the same application server as Flex using AMF, or an HTTP URL that returns XML.
The MXML components that provide data access are called RPC components. MXML includes the following types of RPC components:
*
WebService provides access to SOAP-based web services.
*
HTTPService provides access to HTTP URLs that return data.
*
RemoteObject provides access to Java objects using the AMF protocol (Adobe LiveCycle Data Services ES only).
The following example shows an application that calls a web service that provides weather information, and displays the current temperature for a given ZIP code. The application binds the ZIP code that a user enters in a control to a web service input parameter. It binds the current temperature value contained in the web service result to a TextArea control.
Remote-procedure-call (RPC)服务给你的程序提供了和远程服务器进行交互的能力,或者让你的程序可以向服务器发送数据。
Flex设计了多种RPC服务的形式,可以让你的程序接入本地或远程服务器端。一个Flex应用程序可以使用“简单对象接入协议”(SOAP),一个和当前Flex程序属于同一个工程的Java对象可一通过AMF,或者HTTP URL来返回一个XML。
提供了数据接入的MXML组件我们称之为RPC组件。MXML包含了一下几种类型的RPC组件:
*
WebService 访问基于SOAP的服务器。
*
HTTPService 访问 HTTP URL 从而得到数据。
*
RemoteObject 使用AMF协议调用Java 对象(仅限于Adobe LiveCycle Data Services ES)。
下面的例子展示了一个应用程序,该程序根据给定的邮政编码来请求服务器端提供的天气信息,并显示出来。程序获得用户在TextInput控件输入的邮政编码,然后作为向服务器进行请求的参数。它将返回的温度值绑定到TextArea控件上。
<?xml version="1.0"?>
<!-- mxml/RPCExample.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<!-- Define the web service connection
(the specified WSDL URL is not functional). -->
<mx:WebService id="WeatherService"
wsdl="http:/example.com/ws/WeatherService?wsdl"
useProxy="false">
<!-- Bind the value of the ZIP code entered in the TextInput control
to the ZipCode parameter of the GetWeather operation. -->
<mx:operation name="GetWeather">
<mx:request>
<ZipCode>{zip.text}</ZipCode>
</mx:request>
</mx:operation>
</mx:WebService>
<mx:Panel title="My Application" paddingTop="10" paddingBottom="10"
paddingLeft="10" paddingRight="10" >
<!-- Provide a ZIP code in a TextInput control. -->
<mx:TextInput id="zip" width="200" text="Zipcode please?"/>
<!-- Call the web service operation with a Button click. -->
<mx:Button width="60" label="Get Weather"
click="WeatherService.GetWeather.send();"/>
<!-- Display the location for the specified ZIP code. -->
<mx:Label text="Location:"/>
<mx:TextArea text="{WeatherService.GetWeather.lastResult.Location}"/>
<!-- Display the current temperature for the specified ZIP code. -->
<mx:Label text="Temperature:"/>
<mx:TextArea
text="{WeatherService.GetWeather.lastResult.CurrentTemp}"/>
</mx:Panel>
</mx:Application>
下图展示了运行效果
分享到:
相关推荐
rpc服务属性按钮全部都是灰色的问题是很严重的问题,但可以解决。
安装打印机时RPC服务器不可用的解决安装打印机时RPC服务器不可用的解决
金蝶K3wise软件登录提示RPC服务器不可用
rpc服务器不可用是什么意思.docx
此时你就得新建此键值,并从网上或者其它电脑 上拷贝"rpcss.dll"文件放到c:\windows\system32目录下面(注意:如果RPC服务不能启动的话."粘贴"功能是不能用的,所 以在用U盘之类的拷贝RPCSS.dll文件,最好是把RPCSS.dll...
分布式系统作业,unix RPC 双服务器单客户端银行系统,一个主服务器,一个备用服务器
Win7运行磁盘管理时提示-RPC服务器不可用-怎么解决.docx
Thrift RPC客户端的服务化框架代码,
loadrunner监控linux资源时报错: Monitor name:unix Resource rpc服务安装方法及需要的相关文件
Dameware不能连接的计算机或RPC服务器不可用等问题。如:错误描述“RPC服务器不可用、远程服务器不存在或不可用”。
rpc服务
JSON-RPC 库用于创建自描述RPC服务
本专题主要通过三个章节实现一个rpc通信的基础功能,来学习RPC服务中间件是如何开发和使用。章节内以源码加说明实战方式来讲解,请尽可能下载源码学习。 - 手写RPC框架第一章《自定义配置xml》 - 手写RPC框架第二章...
NULL 博文链接:https://cygogo.iteye.com/blog/902916
安装打印机时RPC服务器不可用的解决方法
perl 实现的rpc-server源码 有POE技术
JsonRPC, 简单的Json RPC PHP客户机/服务器只 JsonRPC PHP客户端和服务器一个简单的json rpc客户机/服务器。 特性仅限 json rpc 2.0服务器支持批处理请求和通知基于身份验证和IP的客户端限制自定义中间件完全单元...
jsonrpc-c-master 基于 json rpc 1.0 纯C开发的服务端代码和示例
1、使用protostuff序列化(.proto文件编写恶心,与Protocol Buffer...后续计划使用该RPC完成基于JAVA的分布式文件服务、分布式KV数据库、部分低代码平台引擎等。过程中通过性能及功能测试对RPC本身进行不断完善及优化。
linux使用,使用教程 linux下安装rpc.rstatd 1.rpc服务需rsh的支持,一般情况下rsh已安装。rpm -qa rsh查看。 2.右键另存为http://heanet.dl.sourceforge.net/sourceforge/rstatd/rpc.rstatd-4.0.1.tar.gz下载rpc....