整理别人的简单配置办法:
1.新建asp.net web工程FlexTest-Compute
WebORB工程目录下的文件(C:\Inetpub\wwwroot\weborb30):
weborb.config 拷贝到FlexTest-Compute工程的根目录
diagnostics.aspx 拷贝到FlexTest-Compute工程的根目录
weborb.dll 拷贝到FlexTest-Compute工程的bin目录
2.引用weborb.dll到FlexTest-Compute项目
3.修改FlexTest-Compute项目的web.config文件,增加:
<httpHandlers>
<add verb="*" path="weborb.aspx" type="Weborb.ORBHttpHandler"/>
<add verb="*" path="codegen.aspx" type= "Weborb.Management.CodeGen.CodegeneratorHttpHandler"/>
</httpHandlers>
4.copy C:\Inetpub\wwwroot\weborb30下的WEB-INF目录到 FlexTest-Compute项目根目录下
5.新建cs文件,添加如下代码:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/**//// <summary>
/// ComputeService 的摘要说明
/// </summary>
public class ComputeService
{
public ComputeService()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public int Compute(int arg1, int arg2)
{
return arg1 + arg2;
}
}
Compute方法实现一个计算2个参数之和的功能。
6.新建flex工程 HelloNet。工程目录是E:\Projects\FlexTest-Compute\FlexTest-Compute\flex,使用ASP.NET的web server,不
用IIS(测试用的就不用劳烦IIS了)
7.修改HelloNet项目的编译属性为:
-locale en_US -services E:\Projects\FlexTest-Compute\FlexTest-Compute\WEB-INF\flex\services-config.xml
8.根据vs.net debug时使用的web server端口,修改HelloNet项目的Build Path和debug,run path :
http://localhost:****/flex/flex_bin/HelloNet.html
在flex application文件中增加代码:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal"
xmlns="http://www.degrafa.com/2007"
>
<mx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
private function getComputerInfoHandler(event : ResultEvent) : void{
Alert.show(event.result.toLocaleString());
}
private function getFaultHandler( event : FaultEvent) : void{
Alert.show("fault");
}
]]>
</mx:Script>
<mx:Button label="test remote" click="compinfo.Compute(1,4);">
</mx:Button>
<mx:RemoteObject id="compinfo" destination="GenericDestination"
source="ComputeService"
showBusyCursor="true" >
<mx:method name="Compute" result="getComputerInfoHandler(event)" fault="getFaultHandler(event);"/>
</mx:RemoteObject>
</mx:Application>
下面是文档里的手动配置帮助:
1. Copy the following files/folders from the default Weborb installation directory to the corresponding folders in
the target virtual directory:
/weborblicense.config (only if exists, contains weborb licensing information)
/bin/weborb.dll (main WebORB assembly)
/bin/cpuinfo.dll
/bin/Npgsql.dll (a database driver used by WebORB Data Management)
/bin/MySql.Data.dll (a database driver used by WebORB Data Management)
/bin/Mono.Security.dll (a database driver used by WebORB Data Management)
/weborb.config (product configuration file)
/weborbee.exe (WebORB Enterprise Edition standalone server)
/weborbee.exe.config (WebORB Enterprise Edition executable config)
/Applications (WebORB Enterprise Edition messaging applications home)
/Global.asax (includes WebORB Enterprise Edition startup and shutdown code. Copy contents if the file already
exists)
/diagnostics.aspx (product diagnostics utility)
/WEB-INF (Flex configuration files home)
/weborbassets (Code generator stylesheets home)
/services (WebORB web services, contains backend support for WDMF plugin for Flex Builder)
/weborb.js (required only for the AJAX clients)
2. Add the following XML configuration to web.config in the target virtual directory:
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="weborb.aspx" type="Weborb.ORBHttpHandler"/>
<add verb="*" path="codegen.aspx" type= "Weborb.Management.CodeGen.CodegeneratorHttpHandler"/>
</httpHandlers>
</system.web>
</configuration>
3. (Optional) To deploy console, examples and code generator, copy the following folders with all files and
subdirectories:
/weborbconsole.html
/console
/examples
/all mdb files from the root
4. (Optional) Create /logs folder as the place where WebORB stores its log files
5. Grant Write permission to the user account ASP.NET uses for the following files and directories:
/weborb.config (required only if making configuration changes from the console)
/logs (required only if logging is enabled)
/weborbassets/codegen (required only if codegen is used in the console)
/weborbassets/uploads
/weborbassets/wdm
/weborbassets/wdm/output
/*.mdb (required only if writing data back on the server in some examples)