AMF 主体在反序列化时被丢弃
我正在尝试通过 BlazeDS 对 ColdFusion 服务器进行简单的 Flex AMF 调用。使用 RemoteObject,我尝试向服务器发送登录请求,并响应成功或失败。由于某种原因,当数据到达 BlazeDS 时,消息正文在反序列化期间被丢弃(我认为)。这是我的 ColdFusion/BlazeDS 日志代码以及 CFC 和 Flex ActionScript 调用。
感谢任何和所有的帮助。感谢!
[BlazeDS]Channel endpoint my-cfamf received request.
[BlazeDS]Deserializing AMF/HTTP request
Version: 3
(Message #0 targetURI=null, responseURI=/3)
(Array #0)
[0] = (Typed Object #0 'flex.messaging.messages.RemotingMessage')
source = "service.UserService"
operation = "authenticateUser"
destination = "ColdFusion"
timestamp = 0
headers = (Object #1)
DSEndpoint = "my-cfamf"
DSId = "883A97CF-4A08-0B8E-9056-1BF562A40EB4"
body = (Array #2)
[0] = "Username"
[1] = "Password"
clientId = null
messageId = "D1743AB9-54B8-E73C-85C7-E990DE7F1ECE"
timeToLive = 0
[BlazeDS]Before invoke service: remoting-service
incomingMessage: Flex Message (flex.messaging.messages.RemotingMessage)
operation = authenticateUser
clientId = 883AAF5D-900B-410A-1E8B-3B3FBD6552A6
destination = ColdFusion
messageId = D1743AB9-54B8-E73C-85C7-E990DE7F1ECE
timestamp = 1300998708880
timeToLive = 0
body = null
hdr(DSId) = 883A97CF-4A08-0B8E-9056-1BF562A40EB4
hdr(DSEndpoint) = my-cfamf
-- Flex
remoteUserService = new RemoteObject;
remoteUserService.destination = "ColdFusion";
remoteUserService.source = "service.UserService";
remoteUserService.authenticateUser.addEventListener("result", authenticate_requestComplete);
remoteUserService.authenticateUser.addEventListener("fault", authenticate_requestFailure);
remoteUserService.authenticateUser({username:username, password:password});
-- ColdFusion
<cffunction name="authenticateUser" access="remote" returnType="Struct">
<cfargument name="username" type="string">
<cfargument name="password" type="string">
<cfset ret = getAuthenticationService().authenticate(username, password) />
<cfreturn ret>
</cffunction>
I am trying to do a simple Flex AMF call to a ColdFusion server via BlazeDS. Using a RemoteObject, I am trying to send a login request to the server, and responding with success or failure. For some reason, when the data gets to BlazeDS, the body of the message gets dropped during deserializaion(I think). Here is my ColdFusion/BlazeDS log code and the CFC and Flex ActionScript call.
Any and all help is appreciated. Thank!
[BlazeDS]Channel endpoint my-cfamf received request.
[BlazeDS]Deserializing AMF/HTTP request
Version: 3
(Message #0 targetURI=null, responseURI=/3)
(Array #0)
[0] = (Typed Object #0 'flex.messaging.messages.RemotingMessage')
source = "service.UserService"
operation = "authenticateUser"
destination = "ColdFusion"
timestamp = 0
headers = (Object #1)
DSEndpoint = "my-cfamf"
DSId = "883A97CF-4A08-0B8E-9056-1BF562A40EB4"
body = (Array #2)
[0] = "Username"
[1] = "Password"
clientId = null
messageId = "D1743AB9-54B8-E73C-85C7-E990DE7F1ECE"
timeToLive = 0
[BlazeDS]Before invoke service: remoting-service
incomingMessage: Flex Message (flex.messaging.messages.RemotingMessage)
operation = authenticateUser
clientId = 883AAF5D-900B-410A-1E8B-3B3FBD6552A6
destination = ColdFusion
messageId = D1743AB9-54B8-E73C-85C7-E990DE7F1ECE
timestamp = 1300998708880
timeToLive = 0
body = null
hdr(DSId) = 883A97CF-4A08-0B8E-9056-1BF562A40EB4
hdr(DSEndpoint) = my-cfamf
-- Flex
remoteUserService = new RemoteObject;
remoteUserService.destination = "ColdFusion";
remoteUserService.source = "service.UserService";
remoteUserService.authenticateUser.addEventListener("result", authenticate_requestComplete);
remoteUserService.authenticateUser.addEventListener("fault", authenticate_requestFailure);
remoteUserService.authenticateUser({username:username, password:password});
-- ColdFusion
<cffunction name="authenticateUser" access="remote" returnType="Struct">
<cfargument name="username" type="string">
<cfargument name="password" type="string">
<cfset ret = getAuthenticationService().authenticate(username, password) />
<cfreturn ret>
</cffunction>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不将凭据作为两个字符串传递,而不是创建一个对象?这样它们就会出现在 CF 中的参数范围中。或者,您可以将其打包到数据传输对象中,但这似乎有点矫枉过正。
Why not pass the credentials across as two strings instead of creating an object? That way they will show up in your arguments scope in CF. Alternatively you can package then in a data transfer object but that seems like overkill for this.