473,977 Members | 2,398 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Return a XmlSchema object

I am writing a web service in C#. One method queries a database for xml
formatted data and responds to the requester with an XMLDocument (this part
works fine). What I want now is another method that will return the schema
for that document.
My idea is to create a DataSet using the xml document and inferring its
schema (the data sources for these xml docs are varied). Then the schema
could be extracted from the dataset and sent to the requester.
But looking at the methods available to DataSet, it seems I would have to
WriteXmlSchema to a file on the server then use XmlSchema.Read to get back a
XmlSchema that I could then send in the response.
Surely there is a better way to get the schema into the response?
Nov 16 '05 #1
1 1428

"Beanweed" <Be******@discu ssions.microsof t.com> wrote in message
news:FB******** *************** ***********@mic rosoft.com...
I am writing a web service in C#. One method queries a database for xml
formatted data and responds to the requester with an XMLDocument (this
part
works fine). What I want now is another method that will return the schema
for that document.
My idea is to create a DataSet using the xml document and inferring its
schema (the data sources for these xml docs are varied). Then the schema
could be extracted from the dataset and sent to the requester.
But looking at the methods available to DataSet, it seems I would have to
WriteXmlSchema to a file on the server then use XmlSchema.Read to get back
a
XmlSchema that I could then send in the response.
Surely there is a better way to get the schema into the response?


Look at the overloads for DataSet.WriteXm lSchema. There's one for
TextWriter and one for Stream. You can write it directly to an Response or
a NetworkStream, or into a string, and write it from there.

David
Nov 16 '05 #2

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

Similar topics

2
3995
by: stub | last post by:
My understanding is that "MyString" is created within the function of "emit" on stack. How could the value of "MyString" be returned to the caller successfully? string emit() { string MyString("This is a string from emit()"); return MyString; }
1
2507
by: Pradeep Kumar | last post by:
I have a scenario where I am writing a property(using get and set) have to return a member of an object stored in an array of objects! The class user has to pass an index based on which a object i's member is returned from the array. How will the property be declared in C#?
4
4274
by: hazz | last post by:
I would like to call a generic method that will pass back a generic object private object getBO(int ID) {return specific_bo;} rather than returning a specific business object private specific_BO getBO(int objID) {return specific_bo;}
0
978
by: ddt | last post by:
Hi, I have an application which need return a sort of similar objects from one function, can I defined web method return as object and to return different objects from it? Thanks in advance.
3
10395
by: Steven W. Orr | last post by:
When I go to create an object I want to be able to decide whether the object is valid or not in __init__, and if not, I want the constructor to return something other than an object, (like maybe None). I seem to be having problems. At the end of __init__ I say (something like) if self.something < minvalue: del self return None and it doesn't work. I first tried just the return None, then I got crafty
12
2184
by: =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= | last post by:
Hi, I have a class which "BiologySequence" which looks about like this. public class BiologySequence { private string _Sequence; public string Sequence {
0
1293
by: Ryan Liu | last post by:
Why IDataParameterCollection.Item return an object, not a IDataParameter? Like DbParameterCollection .GetParameter() -DbParameter Thanks! Ryan
0
2046
by: =?Utf-8?B?TGFzdGJ1aWxkZXJz?= | last post by:
Hi all, I have a weird problem which has been causing me a headache for the last two days. I have to dynamicly generate a schema in memory and load it into a dataset in memory to be returned for further use. To create the schema I am using the XMLSchema classes and the result is the
4
9765
by: chemlight | last post by:
Alright. I'm a php developer, working with JAVA. I've had some luck so far, to the point of being able to remove child nodes in my HTML page. What I need now is a way to return all child node's ids. Example of my HTML <div id="parent"> <span id="child1"></span> <span id="child2"></span> </div> I've tried this: document.getElementById('divError').innerHTML = '1';
0
10172
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11413
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
11581
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
10916
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
10085
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
8464
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
7615
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
6561
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5159
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.