473,414 Members | 1,628 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,414 software developers and data experts.

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 1402

"Beanweed" <Be******@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.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.WriteXmlSchema. 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
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...
1
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 ...
4
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...
0
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
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...
12
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
by: Ryan Liu | last post by:
Why IDataParameterCollection.Item return an object, not a IDataParameter? Like DbParameterCollection .GetParameter() -DbParameter Thanks! Ryan
0
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...
4
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....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.