最近不少網(wǎng)友反映使用Fluorine實(shí)現(xiàn)Flex與.NET通信老是出錯(cuò),原因肯定不一樣,為節(jié)約時(shí)間,我想有必要整理一下Flex RPC常見錯(cuò)誤。此處先整理一下Flash Remoting方面的,后續(xù)會(huì)加上HTTP Service和Web Service的。
一、Flex Remoting
- Channel definition, mx.messaging.channels.RTMPChannel, can not be found...:最新版的Fluorined在services-config.xml中新增了RTMP Channel,主要是用來配 置Flex Messaging,編譯時(shí)需要FDS.swc支持,當(dāng)然如果不需要此功能可以注釋掉channel-definition這個(gè)節(jié)點(diǎn)。
- RPC Fault faultString="The requested type... is not accessible":Flash Remoting服務(wù)名不對(duì)。詳見Flash Remoting支持的遠(yuǎn)程服務(wù)。
- RPC Fault faultString="Could not find a suitable method with name ..." :找不到對(duì)應(yīng)的方法。首選看方法名對(duì)不對(duì),再看方法的參數(shù)個(gè)數(shù), 參數(shù)類型,還要檢查返回?cái)?shù)據(jù)的類型。關(guān)于數(shù)據(jù)的類型詳見Flex AS3數(shù)據(jù)類型轉(zhuǎn)換成Fluorine數(shù)據(jù)類型和 Fluorine .NET數(shù)據(jù)類型轉(zhuǎn)換成Flex AS3數(shù)據(jù)類型。
- NetConnection.Call.Failed: HTTP: Status 404: url...: '虛擬主機(jī)的域名/子目錄/Gateway.aspx'":沒將Root URL設(shè)置為虛擬主機(jī)的域名。詳見Flex Bulider 2與Flash cs3的發(fā)布文件 。
- RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed errorNetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost/Gateway.aspx...'": Root URL中包含的Context與Context root中設(shè)置的不一致。
- [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Security.Error error Error #2048...: 安全沙箱沖突
- RPC Fault faultString="MessagingError message='Destination 'fluorine' either does not exist or the destination has no channels defined (and the application does not define any default channels.)'" faultCode="InvokeFailed" faultDetail="Couldn't establish a connection to 'fluorine'"...:FluorineFX沒配置或destination 沒有定義channels(默認(rèn)是fluorine),詳見配置支持Fluorine Remoting的Web應(yīng)用
- ReferenceError: Error #1056: 無法為 ...創(chuàng)建屬性...:當(dāng)使用[RemoteClass(alias="XXX")],客戶端與服務(wù)器端Value Object映射時(shí)屬性名不一 致。
二、Http Service
- faultCode:Server.Proxy.Request.Failed faultString:'HTTP/1.1 404 Not Found' faultDetail:'HTTP/1.1 404 Not Found':url錯(cuò)誤。
- faultCode:Channel.Security.Error faultString:'Security error accessing url' faultDetail:'Destination: DefaultHTTP':不使用代理時(shí)遇到 安全沙箱沖突。
- The URL specified XXX is not allowed by the selected destination 'DefaultHTTP:使用默認(rèn)終端代理時(shí)遇到安全沙箱沖突。
- No destination with id XXX is registered with any service/MessagingError message='Destination 'students' either does not exist or the destination has no channels defined (and the application does not define any default channels.)':.使用命名終端代理時(shí),destination不一致。