Following is the flex code to import a csv data file via c# webservice.
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");
}
and following is the 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;
}
The application works fine on my development environment, whereas when I run it on the production server I get the following error message:
[RPC Fault faultString="SOAP Response Version Mismatch" faultCode="DecodingError" faultDetail="null"] (404)
Development Environment is: Win7, MSSQL Server 2005, MS Visual Studio 2010, .NET Framework version 4.0.30319
Live Server: Win2008 Server, MSSQL Server 2005, IIS7, .NET Framework version 4.0.30319
Can anyone think of a reason regarding why I get the error message above on the live server?
Thanks.