473,770 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.companyname here.webservice s.CheckList

Dim wsCallback As New AsyncCallback(A ddressOf ProcessCallBack )
webService.Begi nSubmit(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.EndS ubmit(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.IAsyncRe sult) As Integer
Dim results() As Object = Me.EndInvoke(as yncResult)
Return CType(results(0 ),Integer)
End Function

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

System.Argument Exception was unhandled
Cannot write XML declaration. WriteStartDocum ent 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 2525
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
526
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 the wierd part. Say their are 500 records in the file. If I run the process once, maybe 250 will appear. If I run it a second time, maybe 400 or all the records will appear.
1
1994
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 order to run their transactions. If the client lossesconnectivity during the transaction, our web service transactioncompletes, but these believe they have a failure. Is thereanyway to check the client connectivity and rollback thetransaction if the...
0
1372
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 switched the call to a synch, the client app got the error message and displayed it nicely to the user. In this client app. the user does not have to do anything while waiting for results to come back from the web, so it makes sense to call the...
0
9617
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10257
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10037
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8931
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.