Flex 3 和肥皂反应?
我想将数据插入 SQL Server,但我不断收到此错误
RPC错误faultString =“SOAP响应无法解码。原始响应:faultCode =“DecodingError”faultDetail =“null”]
我整天都可以获取数据,但为什么我无法输入任何数据?
<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>
I want to insert data into a SQL Server, but I keep getting this error
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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您在 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.