加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flex中endpoint的作用是什么?

发布时间:2020-12-15 04:30:40 所属栏目:百科 来源:网络整理
导读:endpoint channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel" endpoint url=" http://127.0.0.1/flexweb/messagebroker/amf " class=" flex .messaging.endpoints.AMFEndpoint" / /channel-definition channel-definition id="my-sec

endpoint

<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://127.0.0.1/flexweb/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint" />

</channel-definition>

<channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
<endpoint url="https://127.0.0.1/flexweb/messagebroker/amfsecure " class="flex.messaging.endpoints.SecureAMFEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
</properties>
</channel-definition>

<channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://127.0.0.1/flexweb/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>true</polling-enabled>
<polling-interval-seconds>4</polling-interval-seconds>
</properties>
</channel-definition>


Flex 调用远程或所在web应用的 BlazeDS服务时,必须建立和远端的通道channel,才能正常通信。
1. 通常的方式是 Flex 在编译时就指定远程的端点Endpoint,service-config.xml 中的Endpoint 配置是 例如:
Xml代码
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
说明:server.name:如果是本机的话,那就是127.0.0.1了,如果发布在网上的话,那一定是一个域名了知道有多么的重要了吧。
server.port:服务器的端口号。
context.root:是你的项目名称。

编译时指定的方式是在加编译参数,例如:

引用
-services "services-config.xml" -context-root "/flexWeb"

services-config.xml 需要放在当前目录下,或者指定BlazeDS所在的配置文件路径。
2. 在 <mx:RemoteObject/> 对象中指定Endpoint参数:
例如:
Xml代码
<mx:RemoteObject id="roOrder" destination="Hello" showBusyCursor="true" endpoint="http://server:8080/flexWeb/messagebroker/amf">
<mx:RemoteObject id="roOrder" destination="Hello" showBusyCursor="true" endpoint="http://server:8080/flexWeb/messagebroker/amf">
说明:1) 全路径: endpoint="http://server:8080/flexWeb/messagebroker/amf" >
2) 基于contextRoot: endpoint="/flexWeb/messagebroker/amf" >
3) 基于当前路径: endpoint="messagebroker/amf" >

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读