473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Error - Non-negative number required.Parameter name: byteCount

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
Sep 17 '08 #1
1 7737
Shashi Sadasivan
1,435 Expert 1GB
Do you have an access to the web service?
If you do then could you log the string that is being received by it.
I think its an issue with sending xml as a string to web services,
but im not sure
Sep 18 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: James | last post by:
Hello Java NG, I not sure if this is the right NG for this type of question but if not please let me know which is, TIA Any way first off let me say I'm a student and this WAS last weeks lab,...
3
by: Gizmo | last post by:
hello all have been trying to write a Mid() function a bit like the one in vb. i come to compile it and there are no errors however when i run it an error accours and it says the program has to...
2
by: Debbie | last post by:
Hi I have developed an application that access an SQL database and installed it on a different machine The installation is successful but when I try to run the application I get the following...
5
by: Yoon-Soo Lee | last post by:
I am using Visual C++ .NET 2003 and running into some linking error from the following template code. The error messages is error LNK2019: unresolved external symbol "class...
7
by: Matthew Del Buono | last post by:
Don't try to solve the problem. I've found a way -- around or fixing it. I'm just curious as to whether this is Microsoft's problem in their compiler or if there's a standard saying this is to be...
4
by: iceColdFire | last post by:
Hi @all, I am trying to include struct and class objects in a union ,like class A{ int a; A(){} }; struct B {
39
by: eruanion | last post by:
Hi, I've been working on this for a while now and I can't seem to find out what is wrong with my code. I have 2 files one c3common.js which only contains javascript functions for my main html page...
10
by: dorkrawk | last post by:
I am having an issue with some VC++ I am writing. I have a struct and I'm trying to call a function from it from a function in another object. here is the struct.... struct JNI_Interface {...
2
by: Ian825 | last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my...
1
by: Alexander Higgins | last post by:
>>Thanks for the response.... Point Taken but this is not the case. Thus, if a person writes a text file on her or his computer and does not use UNICODE to save it, the current code page is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.