Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 04:11 AM
Eddie J
Guest
 
Posts: n/a
Default 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>

  #2  
Old November 12th, 2005, 04:11 AM
Kevin Yu [MSFT]
Guest
 
Posts: n/a
Default RE: intermittent error calling .NET web service

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."

  #3  
Old November 12th, 2005, 04:11 AM
Eddie J
Guest
 
Posts: n/a
Default RE: intermittent error calling .NET web service

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:
[color=blue]
> 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."
>
>[/color]
  #4  
Old November 12th, 2005, 04:12 AM
[MSFT]
Guest
 
Posts: n/a
Default RE: intermittent error calling .NET web service

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

  #5  
Old November 12th, 2005, 04:12 AM
Eddie J
Guest
 
Posts: n/a
Default RE: intermittent error calling .NET web service

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:
[color=blue]
> 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
>
>[/color]
  #6  
Old November 12th, 2005, 04:12 AM
Eddie J
Guest
 
Posts: n/a
Default RE: intermittent error calling .NET web service

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:
[color=blue]
> 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:
>[color=green]
> > 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
> >
> >[/color][/color]
  #7  
Old November 12th, 2005, 04:12 AM
Kevin Yu [MSFT]
Guest
 
Posts: n/a
Default RE: intermittent error calling .NET web service

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."

  #8  
Old November 12th, 2005, 04:12 AM
[MSFT]
Guest
 
Posts: n/a
Default RE: intermittent error calling .NET web service

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

  #9  
Old November 12th, 2005, 04:12 AM
Eddie J
Guest
 
Posts: n/a
Default RE: intermittent error calling .NET web service

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:
[color=blue]
> 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
>
>[/color]
  #10  
Old November 12th, 2005, 04:12 AM
[MSFT]
Guest
 
Posts: n/a
Default RE: intermittent error calling .NET web service

Thank you for the update. I am very gald to hear the problem has been
resolved.

Luke

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,174 network members.