Flex HTTPService:无法解码 SOAP 响应。原始响应:
我正在尝试将我的 Flex 应用程序连接到我拥有的调用方法的 CFC。这是为了测试登录控件,当我输入正确的凭据时,它会返回错误:“SOAP 响应无法解码。原始响应:”。
CFC方法是:
<!--- Array of Users is called --->
<cfset user = EntityLoad( "User", {emailAddress='#arguments.emailAddress#', password='#arguments.password#'}, true ) />
<cfset returnvar = "false"/>
<cftry>
<cfif user[1].firstName>
<cfset returnvar = "true"/>
<cfelse>
<cfset returnvar = "true"/>
</cfif>
<cfcatch type="any">
<cfset returnvar = "false"/>
</cfcatch>
</cftry>
<cfreturn returnvar />
</cffunction>
我不知道如何装饰这个。 CFC 方法返回一个字符串,我将其用作标志。是否应该改变这一点? 谢谢大家
I am trying to connect my flex app to a CFC I have which calls a method. It's to test a login control, and when i put the correct credentials in, it comes back with the error: "SOAP Response cannot be decoded. Raw response: ".
The CFC method is:
<!--- Array of Users is called --->
<cfset user = EntityLoad( "User", {emailAddress='#arguments.emailAddress#', password='#arguments.password#'}, true ) />
<cfset returnvar = "false"/>
<cftry>
<cfif user[1].firstName>
<cfset returnvar = "true"/>
<cfelse>
<cfset returnvar = "true"/>
</cfif>
<cfcatch type="any">
<cfset returnvar = "false"/>
</cfcatch>
</cftry>
<cfreturn returnvar />
</cffunction>
I am not sure how to decore this. The CFC method returns back a string, which i use as a flag. Should that be changed?
Thanks guys
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为正在发生的事情如下:
1:返回一个用户(“Bob”)
2:CF 尝试将 user[1].firstname 评估为布尔值,但 Bob 不是布尔值
3:returnvar 设置为 false,但错误阻止函数继续处理(这是猜测)
4:预期值类型未返回到 Flex,因此 Flex 错误
首先,我通过将 catch 块更改为
then 来测试步骤 3,而不是打开user[1].firstname,我会打开 user.recordcount。
Here is what I think is happening:
1: A user is returned ("Bob")
2: CF tries to evaluate user[1].firstname as a boolean, but Bob is not a boolean
3: The returnvar is set to false, but the error stops the function from continuing processing (this is a guess)
4: The expected value type is not returned to Flex, so Flex errors
First, I'd test step 3 by changing the catch block to
Then, instead of switching on user[1].firstname, I'd switch on user.recordcount.