Flex 3和肥皂响应? [英] Flex 3 and soap response?
问题描述
我想插入数据到一个SQL Server,但我不断收到这个错误
$ b
I want to insert data into a SQL Server, but I keep getting this error
RPC Fault faultString =SOAP Response can not be原始响应:faultCode =DecodingErrorfaultDetail =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>
推荐答案
并试图在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。这源于Flex在响应为500时无法读取错误的详细信息。以下是实际的Fault 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 Response can not be decode。Raw response:faultCode =DecodingErrorfaultDetail =null] messageId =52E31332-D231-3C4C-E2D1-0DDB1A1885D0type =faultbubbles = false cancelable = true eventPhase = 2]
这篇关于Flex 3和肥皂响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!