简体   繁体   中英

Why do I get “SOAP Response Version Mismatch”

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.

I figured the problem. The data file I was trying to import was of 7MB text file. I split it into 2 files and tried to import then it worked. So the problem was the size of the data being transferred to the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM