Welcome

首页 / 软件开发 / Flex / 如何在Flex 3 RIA中使用WCF服务

如何在Flex 3 RIA中使用WCF服务2010-11-23 javaeye lzy.je这两天应需要研究了下 WCF 服务和 Flex 3 RIA 相关的开发技术,并上手写 了一些代码 ,发现之前的考虑有不少细节问题需要注意、解决,打算用这篇持 续更新的文章来做以记录 ,将通过 Flex 3 RIA 应用来使用 WCF 服务过程中发 现的问题和解决方法以注意事项的形式 记录清楚。正所谓吃一堑长一智,也请 大家多多分享,一起补充。

1. WCF 服务使用的 SOAP 版本

2. “Provider com.bea.XML.stream.MXParserFactory not found” 异 常

3. 启用“basicHttpBinding” 绑定的 Session 支持

WCF 服务使用的 SOAP 版本

当前发布的 Flex 3.2.0 build 3958 版本仅支持与使用了 SOAP 1.1 协议的 Web 服务通 信,因此如果想在 Flex 3 RIA 应用中使用 WCF 服务,则必须配置 WCF 服务为底层使用 SOAP 1.1 协议通 信。具体方法可以通过更改服务配置文件 Web.config 来完成。

XML代码

<services>
<service behaviorConfiguration="CEELS.Service.BaseBehavior" name="CEELS.Service.CEELSSvc">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICEELSSvc" contract="CEELS.Service.ICEELSSvc">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>

<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ICEELSSvc" allowCookies="true" />
</basicHttpBinding>
</bindings>