Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
|
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 25th, 2007, 08:55 AM
Registered User
 
Join Date: Jun 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default xml text reader from Web Service

I have a test app. It creates an XMLTextReader with the following code:

myXMLTextReader = New Xml.XmlTextReader("PurchaseOrder.xml")

Code runs fine. Object is created and subsequently read into a dataset.

I use the same code in a web service. Same exact xml file, down to the same copy.

The object does not get created. Error is: The data at the root level is invalid. Line 1, position 1.

It seems there may be a namespace conflict, or schema conflict, but I don't understand it.

Any ideas or thought would be appreciated.

DJC
 
Old June 25th, 2007, 09:01 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What code is throwing that error? Your code or the web service code? Probably the problem lies in the web service reply serialization.

-Peter
 
Old June 26th, 2007, 10:12 AM
Registered User
 
Join Date: Jun 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It's the web service code that throws the error. Specifically the very line

myXMLTextReader = New Xml.XmlTextReader("PurchaseOrder.xml")

Tell me more about web service reply serialization, troubleshooting, or an article or book I could look at.

Thanks.
DJC
 
Old June 26th, 2007, 12:49 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

That error on that line of code would imply that the xml in that file is malformed. That's the only thing I can imagine.

In my opinion, the fact that you are doing this in a web service is irrelevant. That code is simply trying to load an XML file and it's choking on that. I would take another look at the contents of that xml file.

-Peter
 
Old June 27th, 2007, 08:40 AM
Registered User
 
Join Date: Jun 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That was my first guess. Problem is it works on a desktop app. xmlTextReader is created and loads the file. I then load into an untyped dataset which then has 3 tables which exactly match the structure of the xml file.

That's what's so puzzling about this.

Thanks for your input.

DJC





Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling Axis web service from .Net - XML Exchange Koushik .NET Web Services 0 October 23rd, 2006 11:40 AM
Extract data from the XML result of a web service s.hendy ASP.NET 1.0 and 1.1 Basics 0 March 16th, 2006 12:27 PM
How to send an xml to a web service agbeltekin General .NET 0 May 10th, 2004 09:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.