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:message>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.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String 
methodName, Object[] parameters)
   at DataSynchronization.ConferenceScheduler.GetAllRegistrations(String 
UserName, String Password)
   at DataSynchronization.RegistrationSyncable.AddWRDataToDataSet(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.ParseBeginTagExpandCharEntities()
   at System.Xml.XmlTextReader.Read()
   at System.Xml.XmlReader.ReadElementString()
   at 
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read15_GetAllRegistrationsResponse()

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

0
ern9876 (5)
1/13/2005 5:31:06 PM
dotnet.xml 7266 articles. 0 followers. Follow

9 Replies
597 Views

Similar Articles

[PageSpeed] 4

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

0
v-kevy (347)
1/14/2005 2:31:59 AM
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:message>Exception: 
System.Web.Services.Protocols.SoapException
Message: Exception or Violation Occurred.
Source: System.Web.Services
   at 
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String 
methodName, Object[] parameters)
   at DataSynchronization.ConferenceScheduler.GetAllAnalysts(String 
UserName, String Password)
   at DataSynchronization.AnalystSyncable.AddWRDataToDataSet(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:message>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.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String 
methodName, Object[] parameters)
   at DataSynchronization.ConferenceScheduler.GetAllRegistrations(String 
UserName, String Password)
   at DataSynchronization.RegistrationSyncable.AddWRDataToDataSet(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.ParseBeginTagExpandCharEntities()
   at System.Xml.XmlTextReader.Read()
   at System.Xml.XmlReader.ReadElementString()
   at 
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read15_GetAllRegistrationsResponse()

</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.webservices 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."
> 
> 
0
ern9876 (5)
1/14/2005 12:27:03 PM
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

0
lukezhan (72)
1/17/2005 8:08:52 AM
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
> 
> 
0
ern9876 (5)
1/18/2005 3:15:06 PM
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
> > 
> > 
0
ern9876 (5)
1/18/2005 3:33:05 PM
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."

0
v-kevy (347)
1/19/2005 5:55:45 AM
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

0
lukezhan (72)
1/19/2005 9:04:10 AM
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
> 
> 
0
ern9876 (5)
1/20/2005 1:43:02 PM
Thank you for the update. I am very gald to hear the problem has been 
resolved.

Luke

0
lukezhan (72)
1/21/2005 2:49:19 AM
Reply:

Similar Artilces:

Receipt intermittently not printing
Customer has ver. 2.0 RMS Store Ops. Database is on a server and there is one POS machine, with 4 back office machines. This was an upgrade from QS2000. We upgraded straight into ver. 2.0 so are running SQL 2005 Server Express. No MSDE installed. Using Epson TM88 printer w/USB connection and Epson OPOS driver. Database upgraded fine, although there was one issue (wrong data in the sale date field) which we solved prior to importing the database into RMS. Not long after initial use of RMS, we started having issues with receipts intermittently not printing. When we investigated we foun...

Instantiating a structure array from XML in .net
Hey All, My app will have a structure array that will hold the parameters used to initialize a array of classes at run time to default values. XML looks like a good candidate to persist the data right? I'd like to have the XML file that persists the structure array. It would be nice to just initially author a XML file with my parameter values in it. It's a bit of a chicken/egg senerio. Is there any way to do this without first serializing the structure to get a XML 'template' file upon which to build? ...

error MIDL2025 : syntax error : expecting { near ","
I get the following error when i try to inherit a interface in a IDL file, error MIDL2025 : syntax error : expecting { near "," inside the IDL file i am trying to use a interface like this, interface IVehicle : ICar, IUnknown { }; Any idea why this error is coming? Thanks ...

Visual C++ .net 2003 question
Hi Newsgroupies, I have a question about Visual C++ .net 2003: Is it possible to embed a Visual C++ .net 2003 application within a web page and for that application to communicate directly over the Internet with another Visual C++ .net 2003 application on another computer? If so, can anyone recommend and example application or articles to get me moving on this? And would it be easier or harder to do this using C#? Thanks in advance, Buzby ...

"Error occurred loading Microsoft functionality" Error on CRM 3.0
Has anyone solved the "Error occurred loading Microsoft functionality" problem in CRM 3.0 Small Business Edition laptop client for Outlook? I tried the hotfix mentioned in KB921540 but it turns out that only installs on Service Provider Edition. My other symptoms include no CRM toolbar in Outlook and and no CRM toolbar listed under Tool > Cutomize > Toolbars. The COM object IS listed under the COM Addins section however. Web access to CRM still works as does my other workstation running the DESKTOP client. Installing the desktop client on the notebook with the problem m...

Tried all solutions for the Error Loading Outlook Client
9 destops all have the CRM client working but 1 The desktop in question did have another user who had no problem using the add-in This user can use the CRM web interface without logging in We have tried every one of the solutions listed in this forum but the "Custom Menu solutions" offered by Msullivan as that would be a network issue for all users not just one...correct? Any other Ideas? Scott C Sorry, error message on previous post said it malfunctioned...this was a copy of that post. "ScottC" wrote: > 9 destops all have the CRM client working but 1 > ...

Error 1304
Outlook has started trying to reinstall everytime I open it up. Than it get so a point and I get "Error 1304 Error writing to file ////PKMAXCTL.DLL verify that you have access to this directory". I have tried reloading outlook but get the same error message. Anyone have a clue I think this was caused by spyware What version of Outlook? Have you tried renaming extend.dat to .old and then reopening Outlook? Have you tried a new mail profile? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus nam...

Outlook Page error
When I go to my work's email the pages comes up but where the messages would be I get "There are no itmes to show in this view. And the error in the bottom corner comes up null is null or not an object. Help!!!! ...

Outlook 2007 Send receive error 0X8DE00006
I just stared receiving the above message in when trying to send from Outlook 2007. I am using Windows 7, and IE. How can I fix this? Thanks "Chuck" <Chuck@discussions.microsoft.com> wrote in message news:0828F2B6-AD0C-4373-BB93-97CED7EDEF67@microsoft.com... >I just stared receiving the above message in when trying to send from Outlook > 2007. I am using Windows 7, and IE. Is this for a Hotmail/Windows Live account accessed by the Outlook Connector by chance? If so, what version of the Connector? Have you tried deleting the account and readding ...

re: error 1320
Dear Glyn Thank you for your reply. To be honest I don't know about the DOS Subst command. I used the administrative tool like you suggested - it shows that I have one disc drive. (I wasn't sure what to do with the c management window...) I tried installing a custom version, and put it on C drive - same result. I did properties of the N and C drive and noticed that they both have exactly the same amount of used and unused space - which seems a bit of a coincidence! They are both NTFS if that is any relevance. I also did map network drives - there is no "n" drive coming...

Pub 2003
After having just upgraded to 2003 from 2000, I attempted to upload a website I created (index_files and index), but it is also not uploading the hyperlinked files as it did in 2000. When viewed on the web, the hyperlinks have the URL of my documents file on my computer. What am I missing here? Gary The hyperlink should read something like; http://www.domainename.com/additionalpath etc. -- Don Vancouver, USA "Dr. Gary" <geedc@adelphia.net> wrote in message news:3aednV_0H5IUpY_cRVn-rw@adelphia.com... > After having just upgraded to 2003 from 2000, I attempted to up...

ERROR IN EXCEL
HI: i have a little problem with excel: i open an excel file and after making a few changes i try to save it but i can't because they program tell me: "impossible to save, a temporal copy have been created " Any idea about this little head-breaker? Thanks!!! Perchance are you doing this from a floppy disk? If so, never work from a floppy. Copy to the HD, work on it there, save on the HD and copy back to the floppy. -- Don Guillett SalesAid Software donaldb@281.com "Aragorn" <oroelfico@yahoo.com> wrote in message news:u2$WepLGEHA.3064@tk2msftngp13.phx.gbl....

Offline Address List errors on clients
Our older exchange 2000 machine died of harddrive failure recently. All mailboxes had already been moved to our new Exchange 2003 server in the same organization. Both servers had public folder replicas. Unfortunately the old 2000 machine held some FSMO roles and such roles as routing group master and it stored the default address lists. I moved all roles to new server, seizing FSMO roles and simply changing exchange details in system manager. All our issues were resolved in this manner except one. Our Office XP and 2003 clients have an error during sync. concerning OAL. I have tried reb...

Addition Error
If i type to A1, "r"(not quote) and B1 "1"(not quote), and C1 "=A1+B1"(not quote), i'm taking an #Value error... How can i solve this issue? =SUM(A1:B1) -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "metude" wrote: > If i type to A1, "r"(not quote) and B1 "1"(not quote), and C1 "=A1+B1"(not > quote), i'm taking an #Value error... How can i solve this issue? Which result are you trying to achieve? If you want a result of:- r1 - then uses th...

Customer Service Reps and Quotes
Can a Customer Service Rep who has a CSR license create quotes? I have adjusted the necessary role rights but how can I add the feature to the users? I would need new > quote from the menu or the quick create button... Thanks It is my understanding that you would need to have a Sales license for this individual in addition to opportunity rights, and adjust the security role (as you have). Then they go to the sales module to create quotes. We do the same thing. We had to give the CSR reps full sales capabilities. You could perhaps copy the "salesperson" role and restrict o...

Adding Streaming video to your web-page is as
Adding Streaming video to your web-page is as simple as a few clicks of the mouse with this amazing tool. http://www.ebvalues.com ...

Error when trying to open saved Publisher 2000 files
I've been using Publisher 2000 for a couple of years. In recent weeks, I have been unable to open saved files. I get "Mspub has caused an error in KERNEL32.DLL. Mspub will now close" error message, and it closes Publisher. I just todsay downloaded updates to Office 2000. The only thing that has changed since I was unable to open these saved files is that I have been diligently doing virus scans, spyware scans, and ad-aware scans. Can anyone help me? -- Thanking you once again for your help. Some articles to ponder OFF2000: Invalid Page Fault in Kernel32.dll Clicking...

Out of Office Error #2
After applying the MS patch "Microsoft Security Bulletin MS04-028: Buffer Overrun in JPEG Processing (GDI+) Could Allow Code Execution (833987)" and starting Outlook 2003, I got the error message " The command is not available. See the program documentation about how to use this extension" when I try to click on the Out of Office Assistant option under the "Tools" menu. This has happened on many Windows 2000 machines that I have. It worked before I installed this patch and I checked to see if the extensions were still enabled; they are. Please help me. ...

Using Excel error #N/A in a formula
I would like to capture the error message #N/A in an IF statement Would like to use IF(MATCH(C1,Range,0)=#N/A,"OK","STOP") but it does not seem to work. What is the correct syntax to capture the #N/A error message and display "OK" instead of #N/A? =IF(ISNA(MATCH(C1,Range,0)),"OK","STOP") HTH Jason Atlanta, GA >-----Original Message----- >I would like to capture the error message #N/A in an IF statement. > >Would like to use IF(MATCH(C1,Range,0)=#N/A,"OK","STOP") but it does not seem to work. What is the...

Recurring activitiy appointments (ie phone call every week)
We've implemented a CRM deployment and just realised we cannot do this. It's a serious shortfall in an account handlers daily duties not to have a reminder which accounts to maintain. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Busi...

RSP file access error
OK, this is weird, and I've not figured out what is going on. One of my clients is using VS7, with the source on a shared file server. The directory is marked as "full access" for "autheticated users" (we've played a bit with this with no difference). What little VS7 use I've done builds a project off my own file server with no problems. Any attempt to build fails with the error that the cl command is unable to access the rsp00003.rsp file. When the cl command executes under VS7, the compiler gives the error that it is unable to find the .rsp file (for some s...

Intermittent display
Hi, recently i encountered this problem on my PC. When i press the ON button, the monitor shows the normal starting up image for only 1 second and then it went black. Then, because my computer has a CPU FAN error (probably because the starting speed of my fan is a little slow), it would beep 3times and prompt me to press F1. During this time, the image would appear on the monitor for 1sec and then, becomes black again. Then, as it loads and enters window, it will flash yet again and i can see the cursor of my mouse at the center of the screen for that 1 second. Everything is running normall...

Unexpected error has occurred....
Every time I type the name of a distribution list into the bcc area (rather than going to the list and clicking "send new message to contact") which then doesn't send the message. Keep in mind distribution list is saved on the server and not on my own pc. Thanks in advance. ...

Intermittently receiving SMTP Error 5.6.1
I have been receiving this error for about 6 months now, but because it lacks a critical status, it just lingers on... A quick infrastructure view - All email is filtered through our Barracuda and sent to our Exchange 2003 server. Email is then forwarded, via the Active Directory setting, to Blackberrys, for those users that have them. For some reason, certain HTML emails are not successfully sent to the Blackberry mail server. I have a 5.6.1 error and an NDR sent to the original sender. Of course, the Exchange mailbox receives it, but the Blackberry does not. This only occurs ...

Fatal Error during install
I get through the CRM Server install, but at the last moment while the system is wrapping up, the following error occurs: ----- "Fatal Error" Installation ended prematurely because of an error. ----- Three databases are created and the web files are copied to the root. Any thoughts on why the installation doesn't complete? Thanks. --Ed Fatal Error during install - More info: The CRM server is on a different box than the SQL server. CRM: Windows 2000, SP3 SQL: Windows 2000, SP3, SQL 2000 Standard, SP3 I have read that there may be an issue with SQL Server SP3, but...