Flex 3 和肥皂反应? [英] Flex 3 and soap response?

查看:23
本文介绍了Flex 3 和肥皂反应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将数据插入到 SQL Server 中,但我一直收到此错误

I want to insert data into a SQL Server, but I keep getting this error

RPC Fault faultString="SOAP 响应无法解码.原始响应:faultCode="DecodingError" faultDetail="null"]

RPC Fault faultString="SOAP Response cannot be decoded. Raw response:faultCode="DecodingError" faultDetail="null"]

我可以整天获取数据,但为什么我不能输入任何数据?

I can get data all day, but why can't I input any?

<mx:WebService id="ws" wsdl="http://localhost:/AService01.asmx?wsdl" 
 fault="onFault(event)">
<mx:operation 
name="GetEmployees" 
resultFormat="object"
result="GetEmployees(event)"/>

</mx:WebService>

<mx:Script>
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.controls.DataGrid;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.wsdl.WSDLBinding;

private function init():void
{
    ws.GetEmployees();
}
[Bindable]
private var res:ArrayCollection;

private function GetEmployees(event:ResultEvent):void 
{
// Databind data from webservice to datagrid

res = event.result as ArrayCollection;
datagrid.dataProvider = res;

//datagrid.dataProvider = event.result[1]; 
UserText.text = event.result[1].firstname + " " + event.result[1].email;// find a better way to get this...
}

private function onFault(event:FaultEvent):void {
    Alert.show(event.fault.toString());
}

private function AddRecord(event:Event):void 
{

// Save a record using a WebService method
ws.SaveEmployee(txtFirstName.text, txtLastName.text, txtEmail.text, txtPhoneNum.text, txtAddress.text, txtCity.text, txtState.text, int(txtZip.text), txtBirthday.text as Date, txtPassword.text ); 
}
</mx:Script>   

推荐答案

当您在 WS 中抛出异常并尝试在 Flex 中正确解析时会出现此错误.查看链接了解更多信息.

This error comes when you are throwing an exception in WS and trying to correctly parse in Flex. Check this link for more info.

Flex 无法处理与 HTTP 500 状态相关的故障.在这种情况下,您将收到 DecodingError.这是因为当响应为 500 时 Flex 无法读取故障的详细信息.这是实际的故障 Flex 返回.

Flex cannot handle faults that are associated with an HTTP 500 status. You will get a DecodingError in this case. This stems from Flex not being able to read the details of a fault when the response is 500. Here is the actual Fault Flex returns.

[FaultEvent fault=[RPC Fault faultString=无法解码 SOAP 响应.原始回复:"faultCode=解码错误";faultDetail="null"] messageId="52E31332-D231-3C4C-E2D1-0DDB1A1885D0" type="fault" bubbles=false cancelable=true eventPhase=2]

这篇关于Flex 3 和肥皂反应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆