473,320 Members | 2,048 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,320 software developers and data experts.

XML Web Service Asynch Result Error in Generated Code

Hope this is the best forum for this, any suggestions for another are
appreciated.

I have a simple Compact Framework (2) app that sends some data to a web
service and acts despending on the response. I added the web service as a web
reference (in VS2005 VB) and then have a bit of code that calls the service
like this:

Dim webService As New com.companynamehere.webservices.CheckList

Dim wsCallback As New AsyncCallback(AddressOf ProcessCallBack)
webService.BeginSubmit(xmlForm, wsCallback, Nothing)

The ProcessCallBack function that handles the asynch result looks like this:

Sub ProcessCallBack(ByVal Response As IAsyncResult)
Dim responseCode As Integer
responseCode = webService.EndSubmit(Response)
End Sub

It appears to submit the data ok, but at the end of the call (EndSubmit) an
error is thrown in the code autogeneated by VS. The function that throws it
looks like this:

Public Function EndSubmit(ByVal asyncResult As System.IAsyncResult) As Integer
Dim results() As Object = Me.EndInvoke(asyncResult)
Return CType(results(0),Integer)
End Function

The error thrown is in the first line, in the Me.EndInvoke(asyncResult),
with the mysterious (to me) error:

System.ArgumentException was unhandled
Cannot write XML declaration. WriteStartDocument method has already written
it.

I can't seem to find any help on this error, no mention on the MS site or in
Google. I follow the basic problem, that it's trying to write the xml
declaration line but that it's already been written, but... well, obviously I
had nothing to do with it being written, and so am thrown as to what to do
here. Any ideas?

Much thanks in advance.
Jan 18 '06 #1
1 2505
It appears that, even though I'm passing the web service an xml node
and not the whole document, if the orginal document has an XML
declaration (<? xml...?>) at the beginning, it will choke. So bizarre.

Jan 19 '06 #2

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

Similar topics

18
by: jabailo | last post by:
I wrote a program that loops through a file of records. It parses each line in the file and sends them to a web service that inserts them into an AS400DB2 database using Asynch calls. This is...
1
by: Darren McDowell via .NET 247 | last post by:
I have a situation, I was wondering if someone could help me. Wehave a .net web service, it runs several transactions in sqlserver 2000. We have several clients which connect to this webservice in...
0
by: Patino | last post by:
I have a particular WS consumer application (Windows app) that was not able to read an error from the WS app because it was calling a method asynch. The client app just hangs there. But once I...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.