简体   繁体   English

使用WebOrb进行Flex远程处理的新手问题

[英]Newbie question for Flex Remoting with WebOrb

Since Flashbuilder does not support WCF over https, i am considering to use weborb remoting as alternative, but not really sure how flash is going to know weborb location, if they are sitting on different servers. 由于Flashbuilder不支持基于https的WCF,因此我正在考虑使用weborb远程处理作为替代方法,但是如果它们位于不同的服务器上,我不确定如何确定flash如何知道weborb的位置。 Looked at destination, source fields, but not really find a field called url in remoteObject in Flex. 查看了目标字段,源字段,但没有真正在Flex的remoteObject中找到名为url的字段。 Has anyone done similar things? 有人做过类似的事情吗?

I know this is an old question, but thought I'd answer it anyway. 我知道这是一个古老的问题,但以为我还是会回答。 You can expose your WCF services to remoting clients (Flash, Flex) via WebORB. 您可以通过WebORB将WCF服务公开给远程客户端(Flash,Flex)。 WebORB supports both self-host and IIS-hosted WCF services. WebORB支持自托管和IIS托管的WCF服务。 Here are links to instructions for both models. 这是两种型号的说明链接。

Self-hosted: http://www.themidnightcoders.com/fileadmin/docs/dotnet/v4/guide/index.html?standalone_wcf_services.htm 自托管: http : //www.themidnightcoders.com/fileadmin/docs/dotnet/v4/guide/index.html?standalone_wcf_services.htm

IIS-hosted: http://www.themidnightcoders.com/fileadmin/docs/dotnet/v4/guide/index.html?iis_hosted_wcf_services.htm IIS托管: http //www.themidnightcoders.com/fileadmin/docs/dotnet/v4/guide/index.html?iis_hosted_wcf_services.htm

Both documents address your questions. 这两个文件都解决了您的问题。 Here is an example of one approach: 这是一种方法的示例:

Invoking Self-Hosted Service From Flex/AIR Flex and AIR clients can use the RemoteObject API to invoke methods on self-hosted WCF services which use the AMF endpoint. 从Flex / AIR调用自托管服务Flex和AIR客户端可以使用RemoteObject API来调用使用AMF端点的自托管WCF服务上的方法。 There are two approaches for invoking self-hosted WCF service. 有两种方法可以调用自托管WCF服务。 The first approach requires less code, but creates a dependency on configuration files declaring destinations and channels (the files located in WEB-INF/flex). 第一种方法需要较少的代码,但是对声明目的地和通道的配置文件(位于WEB-INF / flex中的文件)产生依赖性。 The second approach does not have any dependencies on the configuration files, but results in a few additional lines of code.Consider the examples of the API below: 第二种方法对配置文件没有任何依赖性,但是会导致一些额外的代码行。请考虑以下API的示例:

Approach 1 (with dependency on configuration files): 方法1(依赖于配置文件):

var remoteObject:RemoteObject = new RemoteObject("GenericDestination"); var remoteObject:RemoteObject = new RemoteObject(“ GenericDestination”);
remoteObject.endpoint = "http://localhost:8000/WCFAMFExample/amf" remoteObject.GetQuote.addEventListener( ResultEvent.RESULT, gotResult ); remoteObject.endpoint =“ http:// localhost:8000 / WCFAMFExample / amf” remoteObject.GetQuote.addEventListener(ResultEvent.RESULT,gotResult); remoteObject.GetQuote.addEventListener( FaultEvent.FAULT, gotError ); remoteObject.GetQuote.addEventListener(FaultEvent.FAULT,gotError); remoteObject.GetQuote( "name" ); remoteObject.GetQuote(“ name”);

The endpoint URL uniquely identifies the WCF service. 端点URL唯一标识WCF服务。 Notice the /amf at the end of the URL, it is required for the AMF endpoint. 请注意,URL末尾的/ amf是AMF端点所必需的。 With the approach demonstrated above, the destination name in the RemoteObject constructor is required however it is not used. 使用上述方法,RemoteObject构造函数中的目标名称是必需的,但未使用。 As a result, for the code to work, the Flex/AIR application must be compiled with additional compile argument: 因此,为了使代码正常工作,必须使用附加的compile参数来编译Flex / AIR应用程序:

-services "C:\\Program Files\\WebORB for .NET\\4.0\\web-inf\\flex\\services-config.xml" -服务“ .NET \\ 4.0 \\ web-inf \\ flex \\ services-config.xml的C:\\ Program Files \\ WebORB”

I hope this helps. 我希望这有帮助。

K ķ

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM