473,387 Members | 1,863 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,387 software developers and data experts.

intermittent error calling .NET web service

I'm getting an intermittent error when calling a .NET web service from a .NET
console application. Both are using v.1.1.4322 of the framework.

Any ideas on what could be causing this? It can fail and then a few seconds
later can work fine.

The exception is:

<log4net:event logger="WRDataSyncApp"
timestamp="2005-01-11T03:00:49.7336956-05:00" level="ERROR" thread="5808"
domain="WRDataSyncApp.exe"
username="CLT01IAWEB010N0\EquityAdmin"><log4net:me ssage>Exception:
System.InvalidOperationException
Message: There is an error in XML document (1, 290).
Source: System.Xml
at System.Xml.Serialization.XmlSerializer.Deserialize (XmlReader
xmlReader, String encodingStyle)
at System.Xml.Serialization.XmlSerializer.Deserialize (XmlReader xmlReader)
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
at DataSynchronization.ConferenceScheduler.GetAllRegi strations(String
UserName, String Password)
at DataSynchronization.RegistrationSyncable.AddWRData ToDataSet(DataSet
ds, ConferenceScheduler webSrvc)
at DataSynchronization.WRDataSync.SynchronizeData()
at WRDataSyncApp.Main(String[] args)

Nested Exception

Exception: System.ArgumentOutOfRangeException
Message: Non-negative number required.
Parameter name: byteCount
Source: mscorlib
at System.Text.UTF8Encoding.GetChars(Byte[] bytes, Int32 byteIndex, Int32
byteCount, Char[] chars, Int32 charIndex, UTF8Decoder decoder)
at System.Text.UTF8Decoder.GetChars(Byte[] bytes, Int32 byteIndex, Int32
byteCount, Char[] chars, Int32 charIndex)
at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset,
Int32 desiredChars, Boolean& readToUserBuffer)
at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)
at System.Xml.XmlScanner.Read()
at System.Xml.XmlScanner.ScanEscape()
at System.Xml.XmlScanner.ScanContent()
at System.Xml.XmlTextReader.ParseBeginTagExpandCharEn tities()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlReader.ReadElementString()
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReader1.Read15_GetAllRegistrationsResp onse()

</log4net:message><log4net:locationInfo class="WRDataSyncApp" method="Main"
file="" line="0" /></log4net:event>

Nov 12 '05 #1
9 4337
Hi,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you're referencing a webservice
from a console app, some exception was thrown. If there is any
misunderstanding, please feel free to let me know.

Could you let me know on which call did the exception thrown. Knowing the
client side code and webservice code will be helpful for me to help you
debugging on this issue.

Also, besides posting here, you can also try the
microsoft.public.dotnet.framework.aspnet.webservic es newsgroup, there are
more people who will answer this question there.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #2
Your understanding of the issue is correct. The exception stack trace has the
answers to your other questions:

<log4net:event logger="WRDataSyncApp"
timestamp="2005-01-12T03:00:04.9038753-05:00" level="ERROR" thread="5876"
domain="WRDataSyncApp.exe"
username="CLT01IAWEB010N0\EquityAdmin"><log4net:me ssage>Exception:
System.Web.Services.Protocols.SoapException
Message: Exception or Violation Occurred.
Source: System.Web.Services
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
at DataSynchronization.ConferenceScheduler.GetAllAnal ysts(String
UserName, String Password)
at DataSynchronization.AnalystSyncable.AddWRDataToDat aSet(DataSet ds,
ConferenceScheduler webSrvc)
at DataSynchronization.WRDataSync.SynchronizeData()
at WRDataSyncApp.Main(String[] args)
</log4net:message><log4net:locationInfo class="WRDataSyncApp" method="Main"
file="" line="0" /></log4net:event>
<log4net:event logger="WRDataSyncApp"
timestamp="2005-01-12T14:00:30.5426304-05:00" level="ERROR" thread="5464"
domain="WRDataSyncApp.exe"
username="CLT01IAWEB010N0\EquityAdmin"><log4net:me ssage>Exception:
System.InvalidOperationException
Message: There is an error in XML document (1, 290).
Source: System.Xml
at System.Xml.Serialization.XmlSerializer.Deserialize (XmlReader
xmlReader, String encodingStyle)
at System.Xml.Serialization.XmlSerializer.Deserialize (XmlReader xmlReader)
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
at DataSynchronization.ConferenceScheduler.GetAllRegi strations(String
UserName, String Password)
at DataSynchronization.RegistrationSyncable.AddWRData ToDataSet(DataSet
ds, ConferenceScheduler webSrvc)
at DataSynchronization.WRDataSync.SynchronizeData()
at WRDataSyncApp.Main(String[] args)

Nested Exception

Exception: System.ArgumentOutOfRangeException
Message: Non-negative number required.
Parameter name: byteCount
Source: mscorlib
at System.Text.UTF8Encoding.GetChars(Byte[] bytes, Int32 byteIndex, Int32
byteCount, Char[] chars, Int32 charIndex, UTF8Decoder decoder)
at System.Text.UTF8Decoder.GetChars(Byte[] bytes, Int32 byteIndex, Int32
byteCount, Char[] chars, Int32 charIndex)
at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset,
Int32 desiredChars, Boolean& readToUserBuffer)
at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)
at System.Xml.XmlScanner.Read()
at System.Xml.XmlScanner.ScanEscape()
at System.Xml.XmlScanner.ScanContent()
at System.Xml.XmlTextReader.ParseBeginTagExpandCharEn tities()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlReader.ReadElementString()
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReader1.Read15_GetAllRegistrationsResp onse()

</log4net:message><log4net:locationInfo class="WRDataSyncApp" method="Main"
file="" line="0" /></log4net:event>
"Kevin Yu [MSFT]" wrote:
Hi,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you're referencing a webservice
from a console app, some exception was thrown. If there is any
misunderstanding, please feel free to let me know.

Could you let me know on which call did the exception thrown. Knowing the
client side code and webservice code will be helpful for me to help you
debugging on this issue.

Also, besides posting here, you can also try the
microsoft.public.dotnet.framework.aspnet.webservic es newsgroup, there are
more people who will answer this question there.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #3
Hello,

From the error message, it seems the web method cannot accept the Argument
byteCount. Since the problem occurred randomly, is the value of byteCount
changed randomly? If we set same value for "byteCount", can the problem be
reproduce?

Luke

Nov 12 '05 #4
Thank you for the reply. "byteCount" is not a parameter of the web method I
am calling. The web method has two parameters: a user id and a password,
which are both, unfortunately, hard coded into the application, so there is
no possibility that they are not being supplied.

"[MSFT]" wrote:
Hello,

From the error message, it seems the web method cannot accept the Argument
byteCount. Since the problem occurred randomly, is the value of byteCount
changed randomly? If we set same value for "byteCount", can the problem be
reproduce?

Luke

Nov 12 '05 #5
One other thing: it would be helpful to know whether the read of the xml
failed on the server side or the client side. Can you determine that from the
exception stack trace?

"Eddie J" wrote:
Thank you for the reply. "byteCount" is not a parameter of the web method I
am calling. The web method has two parameters: a user id and a password,
which are both, unfortunately, hard coded into the application, so there is
no possibility that they are not being supplied.

"[MSFT]" wrote:
Hello,

From the error message, it seems the web method cannot accept the Argument
byteCount. Since the problem occurred randomly, is the value of byteCount
changed randomly? If we set same value for "byteCount", can the problem be
reproduce?

Luke

Nov 12 '05 #6
Hi,

We have replied to you on another thread in webservice newsgroup. Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #7
From the Stack Trace, the problem occurred on client side. And the
response data from web service is in incorrect format. Is .NET framework
1.1 installed on both of your server and client?

Luke

Nov 12 '05 #8
I believe we have found a solution to the problem. The web service has
security features that prevent only certain IPs to call the web service. The
web service was also external to the the corporate network I work within.
When the call left the network, the IP address changed and would not be in
the range of acceptable IPs, but sometimes it would.

Thanks for your help on this issue. I appreciate your prompt responses.

"[MSFT]" wrote:
From the Stack Trace, the problem occurred on client side. And the
response data from web service is in incorrect format. Is .NET framework
1.1 installed on both of your server and client?

Luke

Nov 12 '05 #9
Thank you for the update. I am very gald to hear the problem has been
resolved.

Luke

Nov 12 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jb_in_marietta | last post by:
I have a Dot Net project that references a COM DLL called "Crypto.dll," which is registered on my machine. I added the reference via the "Add Reference" dialog in Visual Studio Dot Net, and I am...
1
by: bloodhound | last post by:
Hi, Problem with global.asa not firing 100% of the time. This error crops up several times throughout the day but if you wait a while and reload the page (could be 5 mins or an hour) it will...
2
by: gary | last post by:
I am using VS.NET 2003 on XP I intermittently get Access is denied '' at the line <add assembly="*"/> in machine.config I have disabled indexing service and I am not running any form of...
1
by: deevoy | last post by:
Hi- I'm developing a asp.net web application and everything has proven fine on the dev and acceptance environment. We've moved the code up to our windows server 2003 prod environment and get...
0
by: Shane C | last post by:
Intermittent Error: Server was unable to process request  Object reference not set to an instance of an object I have windows application that references a XML web service on our web server. ...
2
by: Liverpool fan | last post by:
I have a VB .NET windows application that is throwing an intermittent 'out of memory' error. Here is the call stack. Out of memory. at System.Drawing.Graphics.FromHdcInternal(IntPtr hdc) at...
1
by: Mark P | last post by:
I've written a .Net 1.1 Web Service that receives a file and forwards the file to another Web Service (this one written in Java). The Web Service generally works, but intermittently gets the...
0
by: Mark P | last post by:
I've written a .Net 1.1 Web Service that receives a file and forwards the file to another Web Service (this one written in Java). The Web Service generally works, but intermittently gets the...
0
by: gelangov | last post by:
I have posted this before. Now I have SQL server 2005 with Service pack 2. The problem is: I get intermittent problem either when I am loading a file into a table or exporting a table into a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.