我想將數據插入到SQL Server,但我不斷收到此錯誤Flex 3和肥皂響應?
RPC故障faultString =「SOAP響應不能被解碼的原始響應:Fault代碼=」 DecodingError」 faultDetail =‘空’]
我可以一整天獲取數據,但爲什麼我不能輸入任何?
<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服務寫? C#?嘗試從瀏覽器調用Web服務,以測試該功能是否正常工作。 – Pbirkoff 2010-04-05 23:50:48
是的,它是用C#編寫的,兩種方法都可以在瀏覽器中正常工作。 – ryan 2010-04-05 23:52:49
你在瀏覽器中運行Flex-app嗎?你可以使用FireBug來查看發送給WebService的值嗎?我想你沒有提供足夠的參數,或者轉換(int或date)導致無效值 – Pbirkoff 2010-04-06 00:01:20