Hi All,
My C# web application calls a webservice to process a report. It sends XMLs as parameter and in response gets an XML node which stores Binay datatype bin.base64.
It makes an instance of the proxy class of webservice and makes a synchronous call to webservice GetReport() op.
Here is the code snippet -
************************************************** *************************************
wbFELIP.wsZProcessReport.ProcessReport report = new wbFELIP.wsZProcessReport.ProcessReport();
System.Xml.XmlNode rptData = null;
rptData = report.GetReport(strXmlReportRequest) ;
************************************************** ***********************************
WSDL -
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://tempuri.org/GetReport", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse .Literal, ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
public System.Xml.XmlNode GetReport(string vXML) {
object[] results = this.Invoke("GetReport", new object[] {
vXML});
return ((System.Xml.XmlNode)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetReport(string vXML, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetReport", new object[] {
vXML}, callback, asyncState);
}
/// <remarks/>
public System.Xml.XmlNode EndGetReport(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((System.Xml.XmlNode)(results[0]));
}
************************************************** ***********************************
The above code was working fine since last 3 years but now it is returns error,
"Non-negative number required.\r\nParameter name: byteCount" .
--
Here is Stack Trace -
" at System.Xml.Serialization.XmlSerializer.Deserialize (XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)\r\n at System.Xml.Serialization.XmlSerializer.Deserialize (XmlReader xmlReader, XmlDeserializationEvents events)\r\n at System.Xml.Serialization.XmlSerializer.Deserialize (XmlReader xmlReader)\r\n at System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)\r\n at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String methodName, Object[] parameters)\r\n at wbFELIP.wsZProcessReport.ProcessReport.GetReport(S tring vXML) in c:\\inetpub\\wwwroot\\wbfelip\\web references\\wszprocessreport\\reference.cs:line 43\r\n at wbFELIP.ReportRequestForm.btnRetrieveReport_Click( Object sender, EventArgs evt) in c:\\inetpub\\wwwroot\\wbfelip\\reportrequestform.a spx.cs:line 710"
ex1.InnerException
{"Non-negative number required.\r\nParameter name: byteCount" }
[System.ArgumentOutOfRangeException]: {"Non-negative number required.\r\nParameter name: byteCount" }
System.Object: {System.ArgumentOutOfRangeException}
_className: null
_COMPlusExceptionCode: -532459699
_exceptionMethod: {System.Reflection.RuntimeMethodInfo}
_exceptionMethodString: null
_helpURL: null
_HResult: -2146233086
_innerException: { }
_message: "Non-negative number required."
_remoteStackIndex: 0
_remoteStackTraceString: null
_source: "mscorlib"
_stackTrace: {System.Array}
_stackTraceString: " at System.Text.UTF8Encoding.GetChars(Byte[] bytes, Int32 byteIndex, Int32 byteCount, Char[] chars, Int32 charIndex, UTF8Decoder decoder)\r\n at System.Text.UTF8Decoder.GetChars(Byte[] bytes, Int32 byteIndex, Int32 byteCount, Char[] chars, Int32 charIndex)\r\n at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredChars, Boolean& readToUserBuffer)\r\n at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)\r\n at System.Xml.XmlScanner.Read()\r\n at System.Xml.XmlScanner.ScanContent()\r\n at System.Xml.XmlTextReader.ParseBeginTagExpandCharEn tities()\r\n at System.Xml.XmlTextReader.Read()\r\n at System.Xml.XmlLoader.LoadChildren(XmlNode parent)\r\n at System.Xml.XmlLoader.LoadElementNode()\r\n at System.Xml.XmlLoader.LoadCurrentNode()\r\n at System.Xml.XmlLoader.LoadChildren(XmlNode parent)\r\n at System.Xml.XmlLoader.LoadElementNode()\r\n at System.Xml.XmlLoader.LoadCurrentNode()\r\n at System.Xml.XmlLoader.Rea
dCurrentNode(XmlDocument doc, XmlReader reader)\r\n at System.Xml.XmlDocument.ReadNode(XmlReader reader)\r\n at System.Xml.Serialization.XmlSerializationReader.Re adXmlNode(Boolean wrapped)\r\n at Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReader1.Read3_GetReportResponse()"
_xcode: -532459699
_xptrs: 0
HelpLink: null
HResult: -2146233086
InnerException: { }
Message: "Non-negative number required.\r\nParameter name: byteCount"
Source: "mscorlib"
StackTrace: " at System.Text.UTF8Encoding.GetChars(Byte[] bytes, Int32 byteIndex, Int32 byteCount, Char[] chars, Int32 charIndex, UTF8Decoder decoder)\r\n at System.Text.UTF8Decoder.GetChars(Byte[] bytes, Int32 byteIndex, Int32 byteCount, Char[] chars, Int32 charIndex)\r\n at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredChars, Boolean& readToUserBuffer)\r\n at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)\r\n at System.Xml.XmlScanner.Read()\r\n at System.Xml.XmlScanner.ScanContent()\r\n at System.Xml.XmlTextReader.ParseBeginTagExpandCharEn tities()\r\n at System.Xml.XmlTextReader.Read()\r\n at System.Xml.XmlLoader.LoadChildren(XmlNode parent)\r\n at System.Xml.XmlLoader.LoadElementNode()\r\n at System.Xml.XmlLoader.LoadCurrentNode()\r\n at System.Xml.XmlLoader.LoadChildren(XmlNode parent)\r\n at System.Xml.XmlLoader.LoadElementNode()\r\n at System.Xml.XmlLoader.LoadCurrentNode()\r\n at System.Xml.XmlLoader.ReadCurren
tNode(XmlDocument doc, XmlReader reader)\r\n at System.Xml.XmlDocument.ReadNode(XmlReader reader)\r\n at System.Xml.Serialization.XmlSerializationReader.Re adXmlNode(Boolean wrapped)\r\n at Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReader1.Read3_GetReportResponse()"
TargetSite: {System.Reflection.RuntimeMethodInfo}
------------------------------------------------------------------------------------------------------------
To make sure I refreshed the WSDL , but still getting same error. I am able to create reports using the webservice in ASP using Get method. Moreover I spoke to webservice administrators , they can see the SOAP request coming on webserver and response is also getting genereated successfully. But I don't know what's wrong in my application code. I googled a lot to find but didn't get any clue.
Any kind of help on this issue will greatly be appreciated !
Regards,
Santosh