【发布时间】:2011-11-26 10:46:19
【问题描述】:
以下是通过 c# webservice 导入 csv 数据文件的 flex 代码。
private function Import():void{
CursorManager.setBusyCursor();
var op:Operation = Operation(_webservice.getOperation('ImportData'));
op.addEventListener(FaultEvent.FAULT,operationFault);
op.addEventListener(ResultEvent.RESULT,operationResult);
var ba:ByteArray = new ByteArray();
ba.writeUTFBytes(objectToXML(datasource.source).toXMLString());
op.arguments = new Array(filename, ba);
op.send();
}
protected function operationFault(e:FaultEvent):void
{
CursorManager.removeBusyCursor();
Alert.show(e.fault + " (" + e.statusCode + ")");
}
protected function operationResult(e:ResultEvent):void
{
datasource.removeAll();
CursorManager.removeBusyCursor();
Alert.show("Success");
}
以下是c# webservice:
[WebMethod]
public XmlDocument ImportData(String filename, byte[] data)
{
Boolean bReturn = false;
/* .... code to import data .... */
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml("<response>" + (bReturn ? "true" : "false") + "</response>");
conn.Close();
return xmlDoc;
}
该应用程序在我的开发环境中运行良好,而当我在生产服务器上运行它时,我收到以下错误消息:
[RPC 故障 faultString="SOAP 响应版本不匹配" faultCode="DecodingError" faultDetail="null"] (404)
开发环境是: Win7、MSSQL Server 2005、MS Visual Studio 2010、.NET Framework 版本 4.0.30319
实时服务器: Win2008 Server、MSSQL Server 2005、IIS7、.NET Framework 4.0.30319版
谁能想到我在实时服务器上收到上述错误消息的原因?
谢谢。
【问题讨论】:
标签: c# web-services soap flex4