473,569 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataSet Vs Xml string

Hi All,

I am very new to web services, so am struggling to understand exactly what I
am doing with regards to its returns etc. I have been given the task of
designing and developing a web service which will allow external companies,
access to our information. The problem for me is that these companies will
be using different platforms from which to consume our web service. My
question is what I should use as the return type for more complex data
structures. Should I use the intrinsic dataset object and return that,
should I create a typed dataset as then a definitive XML Schema will be
produced, or should I just build and XML string from the information I return
from the database and send that back across.

I know that all the return types are serialized into XML, but does this mean
that they can be accessed when they get to other end?? I would really
appreciate some input here, if anyone can help me understand this that would
be great!

Thanks,

Rob

Nov 23 '05 #1
17 3416
Take alook at Christian Weyer WS-Contract first, it's good tool for you
to get started in designing web services. Remember services rely on
schema as a contract not type.

BTW, avoid ADO.Net dataset at all cost. It will not work since dataset
is a strongly related to .Net.

regards
erymuzuan mustapa

Modica82 wrote:
Hi All,

I am very new to web services, so am struggling to understand exactly what I
am doing with regards to its returns etc. I have been given the task of
designing and developing a web service which will allow external companies,
access to our information. The problem for me is that these companies will
be using different platforms from which to consume our web service. My
question is what I should use as the return type for more complex data
structures. Should I use the intrinsic dataset object and return that,
should I create a typed dataset as then a definitive XML Schema will be
produced, or should I just build and XML string from the information I return
from the database and send that back across.

I know that all the return types are serialized into XML, but does this mean
that they can be accessed when they get to other end?? I would really
appreciate some input here, if anyone can help me understand this that would
be great!

Thanks,

Rob

Nov 23 '05 #2
Hi Erymuzuan,

Does this mean i should generate my own XML to send back, again i have not
done loads of XML so this will take some doing, would it be best to send the
XML back with a schema, or just send the XML down the wire as a string?

Rob

"erymuzuan" wrote:
Take alook at Christian Weyer WS-Contract first, it's good tool for you
to get started in designing web services. Remember services rely on
schema as a contract not type.

BTW, avoid ADO.Net dataset at all cost. It will not work since dataset
is a strongly related to .Net.

regards
erymuzuan mustapa

Modica82 wrote:
Hi All,

I am very new to web services, so am struggling to understand exactly what I
am doing with regards to its returns etc. I have been given the task of
designing and developing a web service which will allow external companies,
access to our information. The problem for me is that these companies will
be using different platforms from which to consume our web service. My
question is what I should use as the return type for more complex data
structures. Should I use the intrinsic dataset object and return that,
should I create a typed dataset as then a definitive XML Schema will be
produced, or should I just build and XML string from the information I return
from the database and send that back across.

I know that all the return types are serialized into XML, but does this mean
that they can be accessed when they get to other end?? I would really
appreciate some input here, if anyone can help me understand this that would
be great!

Thanks,

Rob

Nov 23 '05 #3
Rob,

In my opinion you should build and return an XML string. In fact, the best
way to do it is to build your xml string and return it as a byte array for
quick performance. Let me know if you'd like a code sample. I have build
several Web Services this way. In fact, I had questions such as yours and I
went straight to Francesco Balena (if you know who he is) and this method was
highly recommended.

This way any company or customer can read it and you are not tied to any
platform or language, that is the beauty of XML.

HOpe this helps.

Scott

"Modica82" wrote:
Hi All,

I am very new to web services, so am struggling to understand exactly what I
am doing with regards to its returns etc. I have been given the task of
designing and developing a web service which will allow external companies,
access to our information. The problem for me is that these companies will
be using different platforms from which to consume our web service. My
question is what I should use as the return type for more complex data
structures. Should I use the intrinsic dataset object and return that,
should I create a typed dataset as then a definitive XML Schema will be
produced, or should I just build and XML string from the information I return
from the database and send that back across.

I know that all the return types are serialized into XML, but does this mean
that they can be accessed when they get to other end?? I would really
appreciate some input here, if anyone can help me understand this that would
be great!

Thanks,

Rob

Nov 23 '05 #4
Not necessarily, the best practive is to design the XML schema for your
web services interface. the use the tool to generate server's web
services stub. or you can use xsd.exe to generate .Net types from your
XML Schema

regards
erymuzuan mustapa

Modica82 wrote:
Hi Erymuzuan,

Does this mean i should generate my own XML to send back, again i have not
done loads of XML so this will take some doing, would it be best to send the
XML back with a schema, or just send the XML down the wire as a string?

Rob

"erymuzuan" wrote:

Take alook at Christian Weyer WS-Contract first, it's good tool for you
to get started in designing web services. Remember services rely on
schema as a contract not type.

BTW, avoid ADO.Net dataset at all cost. It will not work since dataset
is a strongly related to .Net.

regards
erymuzuan mustapa

Modica82 wrote:
Hi All,

I am very new to web services, so am struggling to understand exactly what I
am doing with regards to its returns etc. I have been given the task of
designing and developing a web service which will allow external companies,
access to our information. The problem for me is that these companies will
be using different platforms from which to consume our web service. My
question is what I should use as the return type for more complex data
structures . Should I use the intrinsic dataset object and return that,
should I create a typed dataset as then a definitive XML Schema will be
produced, or should I just build and XML string from the information I return
from the database and send that back across.

I know that all the return types are serialized into XML, but does this mean
that they can be accessed when they get to other end?? I would really
appreciate some input here, if anyone can help me understand this that would
be great!

Thanks,

Rob

Nov 23 '05 #5
Hi Scott,

I was planning on using the XMLTextWriter class to create XML on the fly and
return it as a string. I have read alot about XML but never really used it
commercially, so i want to get it write (also i have only been at this job a
month and trying to impress :)) Some code samles would be great if you could
send them.

Thanks in Advance,

Rob

"SQLScott" wrote:
Rob,

In my opinion you should build and return an XML string. In fact, the best
way to do it is to build your xml string and return it as a byte array for
quick performance. Let me know if you'd like a code sample. I have build
several Web Services this way. In fact, I had questions such as yours and I
went straight to Francesco Balena (if you know who he is) and this method was
highly recommended.

This way any company or customer can read it and you are not tied to any
platform or language, that is the beauty of XML.

HOpe this helps.

Scott

"Modica82" wrote:
Hi All,

I am very new to web services, so am struggling to understand exactly what I
am doing with regards to its returns etc. I have been given the task of
designing and developing a web service which will allow external companies,
access to our information. The problem for me is that these companies will
be using different platforms from which to consume our web service. My
question is what I should use as the return type for more complex data
structures. Should I use the intrinsic dataset object and return that,
should I create a typed dataset as then a definitive XML Schema will be
produced, or should I just build and XML string from the information I return
from the database and send that back across.

I know that all the return types are serialized into XML, but does this mean
that they can be accessed when they get to other end?? I would really
appreciate some input here, if anyone can help me understand this that would
be great!

Thanks,

Rob

Nov 23 '05 #6
Ask and ye shall receive.

Web Service Code:
<WebMethod()> _
Public Function GetData() As Byte()
Dim ms As MemoryStream
Dim xmlms() As Byte

ms = New MemoryStream

'code to get data goes here

'Now create your xml doc
xtw.Formatting = Formatting.Inde nted
xtw.Indentation = 2

xtw.QuoteChar = """"c

xtw.WriteStartD ocument(True)

xtw.WriteCommen t("Data from db")

xtw.WriteStartE lement("Data")

xtw.WriteStartE lement("Employe e")
Dim xtw As New Xml.XmlTextWrit er(ms, System.Text.Enc oding.UTF8)

xtw.WriteElemen tString("FirstN ame", "Evel")
xtw.WriteElemen tString("LastNa me", "Knievel")

xtw.WriteEndEle ment() 'closes the data node
xtw.WriteEndEle ment() 'closes the employee node

xtw.WriteEndDoc ument()

xtw.Flush()
xmlms = ms.ToArray

ms.Close()
xtw.Close()

Return xmlms

End Function

Hope this help!

Scott

"Modica82" wrote:
Hi Scott,

I was planning on using the XMLTextWriter class to create XML on the fly and
return it as a string. I have read alot about XML but never really used it
commercially, so i want to get it write (also i have only been at this job a
month and trying to impress :)) Some code samles would be great if you could
send them.

Thanks in Advance,

Rob

"SQLScott" wrote:
Rob,

In my opinion you should build and return an XML string. In fact, the best
way to do it is to build your xml string and return it as a byte array for
quick performance. Let me know if you'd like a code sample. I have build
several Web Services this way. In fact, I had questions such as yours and I
went straight to Francesco Balena (if you know who he is) and this method was
highly recommended.

This way any company or customer can read it and you are not tied to any
platform or language, that is the beauty of XML.

HOpe this helps.

Scott

"Modica82" wrote:
Hi All,

I am very new to web services, so am struggling to understand exactly what I
am doing with regards to its returns etc. I have been given the task of
designing and developing a web service which will allow external companies,
access to our information. The problem for me is that these companies will
be using different platforms from which to consume our web service. My
question is what I should use as the return type for more complex data
structures. Should I use the intrinsic dataset object and return that,
should I create a typed dataset as then a definitive XML Schema will be
produced, or should I just build and XML string from the information I return
from the database and send that back across.

I know that all the return types are serialized into XML, but does this mean
that they can be accessed when they get to other end?? I would really
appreciate some input here, if anyone can help me understand this that would
be great!

Thanks,

Rob

Nov 23 '05 #7
Thanks Scott,

Has given me some ideas

Rob

"SQLScott" wrote:
Ask and ye shall receive.

Web Service Code:
<WebMethod()> _
Public Function GetData() As Byte()
Dim ms As MemoryStream
Dim xmlms() As Byte

ms = New MemoryStream

'code to get data goes here

'Now create your xml doc
xtw.Formatting = Formatting.Inde nted
xtw.Indentation = 2

xtw.QuoteChar = """"c

xtw.WriteStartD ocument(True)

xtw.WriteCommen t("Data from db")

xtw.WriteStartE lement("Data")

xtw.WriteStartE lement("Employe e")
Dim xtw As New Xml.XmlTextWrit er(ms, System.Text.Enc oding.UTF8)

xtw.WriteElemen tString("FirstN ame", "Evel")
xtw.WriteElemen tString("LastNa me", "Knievel")

xtw.WriteEndEle ment() 'closes the data node
xtw.WriteEndEle ment() 'closes the employee node

xtw.WriteEndDoc ument()

xtw.Flush()
xmlms = ms.ToArray

ms.Close()
xtw.Close()

Return xmlms

End Function

Hope this help!

Scott

"Modica82" wrote:
Hi Scott,

I was planning on using the XMLTextWriter class to create XML on the fly and
return it as a string. I have read alot about XML but never really used it
commercially, so i want to get it write (also i have only been at this job a
month and trying to impress :)) Some code samles would be great if you could
send them.

Thanks in Advance,

Rob

"SQLScott" wrote:
Rob,

In my opinion you should build and return an XML string. In fact, the best
way to do it is to build your xml string and return it as a byte array for
quick performance. Let me know if you'd like a code sample. I have build
several Web Services this way. In fact, I had questions such as yours and I
went straight to Francesco Balena (if you know who he is) and this method was
highly recommended.

This way any company or customer can read it and you are not tied to any
platform or language, that is the beauty of XML.

HOpe this helps.

Scott

"Modica82" wrote:

> Hi All,
>
> I am very new to web services, so am struggling to understand exactly what I
> am doing with regards to its returns etc. I have been given the task of
> designing and developing a web service which will allow external companies,
> access to our information. The problem for me is that these companies will
> be using different platforms from which to consume our web service. My
> question is what I should use as the return type for more complex data
> structures. Should I use the intrinsic dataset object and return that,
> should I create a typed dataset as then a definitive XML Schema will be
> produced, or should I just build and XML string from the information I return
> from the database and send that back across.
>
> I know that all the return types are serialized into XML, but does this mean
> that they can be accessed when they get to other end?? I would really
> appreciate some input here, if anyone can help me understand this that would
> be great!
>
> Thanks,
>
> Rob
>

Nov 23 '05 #8
OK, let me know if you have any question.

There is a copy/paste error in the code below. The "Dim xtw As New
Xml.XmlTextWrit er(ms, System.Text.Enc oding.UTF8)" statement should go with
the rest of the other Dim statements.

Sorry about that.

Scott

"Modica82" wrote:
Thanks Scott,

Has given me some ideas

Rob

"SQLScott" wrote:
Ask and ye shall receive.

Web Service Code:
<WebMethod()> _
Public Function GetData() As Byte()
Dim ms As MemoryStream
Dim xmlms() As Byte

ms = New MemoryStream

'code to get data goes here

'Now create your xml doc
xtw.Formatting = Formatting.Inde nted
xtw.Indentation = 2

xtw.QuoteChar = """"c

xtw.WriteStartD ocument(True)

xtw.WriteCommen t("Data from db")

xtw.WriteStartE lement("Data")

xtw.WriteStartE lement("Employe e")
Dim xtw As New Xml.XmlTextWrit er(ms, System.Text.Enc oding.UTF8)

xtw.WriteElemen tString("FirstN ame", "Evel")
xtw.WriteElemen tString("LastNa me", "Knievel")

xtw.WriteEndEle ment() 'closes the data node
xtw.WriteEndEle ment() 'closes the employee node

xtw.WriteEndDoc ument()

xtw.Flush()
xmlms = ms.ToArray

ms.Close()
xtw.Close()

Return xmlms

End Function

Hope this help!

Scott

"Modica82" wrote:
Hi Scott,

I was planning on using the XMLTextWriter class to create XML on the fly and
return it as a string. I have read alot about XML but never really used it
commercially, so i want to get it write (also i have only been at this job a
month and trying to impress :)) Some code samles would be great if you could
send them.

Thanks in Advance,

Rob

"SQLScott" wrote:

> Rob,
>
> In my opinion you should build and return an XML string. In fact, the best
> way to do it is to build your xml string and return it as a byte array for
> quick performance. Let me know if you'd like a code sample. I have build
> several Web Services this way. In fact, I had questions such as yours and I
> went straight to Francesco Balena (if you know who he is) and this method was
> highly recommended.
>
> This way any company or customer can read it and you are not tied to any
> platform or language, that is the beauty of XML.
>
> HOpe this helps.
>
> Scott
>
> "Modica82" wrote:
>
> > Hi All,
> >
> > I am very new to web services, so am struggling to understand exactly what I
> > am doing with regards to its returns etc. I have been given the task of
> > designing and developing a web service which will allow external companies,
> > access to our information. The problem for me is that these companies will
> > be using different platforms from which to consume our web service. My
> > question is what I should use as the return type for more complex data
> > structures. Should I use the intrinsic dataset object and return that,
> > should I create a typed dataset as then a definitive XML Schema will be
> > produced, or should I just build and XML string from the information I return
> > from the database and send that back across.
> >
> > I know that all the return types are serialized into XML, but does this mean
> > that they can be accessed when they get to other end?? I would really
> > appreciate some input here, if anyone can help me understand this that would
> > be great!
> >
> > Thanks,
> >
> > Rob
> >

Nov 23 '05 #9
Thanks again Scott,

I do have a quick question, but you may or may not have the answer, have you
ever created any sort of schema(xsd) to be passed back with your XML, if so
how did you do it?

Thanks in advance,

Rob

"Modica82" wrote:
Hi Scott,

I was planning on using the XMLTextWriter class to create XML on the fly and
return it as a string. I have read alot about XML but never really used it
commercially, so i want to get it write (also i have only been at this job a
month and trying to impress :)) Some code samles would be great if you could
send them.

Thanks in Advance,

Rob

"SQLScott" wrote:
Rob,

In my opinion you should build and return an XML string. In fact, the best
way to do it is to build your xml string and return it as a byte array for
quick performance. Let me know if you'd like a code sample. I have build
several Web Services this way. In fact, I had questions such as yours and I
went straight to Francesco Balena (if you know who he is) and this method was
highly recommended.

This way any company or customer can read it and you are not tied to any
platform or language, that is the beauty of XML.

HOpe this helps.

Scott

"Modica82" wrote:
Hi All,

I am very new to web services, so am struggling to understand exactly what I
am doing with regards to its returns etc. I have been given the task of
designing and developing a web service which will allow external companies,
access to our information. The problem for me is that these companies will
be using different platforms from which to consume our web service. My
question is what I should use as the return type for more complex data
structures. Should I use the intrinsic dataset object and return that,
should I create a typed dataset as then a definitive XML Schema will be
produced, or should I just build and XML string from the information I return
from the database and send that back across.

I know that all the return types are serialized into XML, but does this mean
that they can be accessed when they get to other end?? I would really
appreciate some input here, if anyone can help me understand this that would
be great!

Thanks,

Rob

Nov 23 '05 #10

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

Similar topics

0
1417
by: a | last post by:
I've read and split a delimited text file into a dataset. It looks fine in a datagrid (5 columns and 5,000 rows), but I've been trying, without success, to then insert the resulting dataset called "result" into a single sql table that has an auto-increment and PK column called ID, as well as the 5 columns from the dataset. Any suggestions...
0
10842
by: a | last post by:
I've read and split a delimited text file into a dataset. It looks fine in a datagrid (5 columns and 5,000 rows), but I've been trying, without success, to then insert the resulting dataset called "result" into a single sql table that has an auto-increment and PK column called ID, as well as the 5 columns from the dataset. Any suggestions...
1
1664
by: Brian Keating | last post by:
hi there, has anyone come across this? i've a typed dataset with a table and a column of type string. I want to insert a new row and for some reason i keep getting "Null" in my dataset. take a simple exply of person Name:string Comment:string
5
1362
by: SMG | last post by:
Hi All, I have a Web Service, which returns a DataSet and I am able to consume. This is ok. Now I want to return two things, 1. DataSet 2. String Through one request only, I thot of using object as a return type to the webservices but then how do I re cast it to string and dataset. Will that work.
1
8060
by: languy | last post by:
Hi there I'm having a problem when using the SqlDataAdapter. When calling the Update(DataSet, string) method I get the following error message "String or binary data would be truncated". The rows neither have data that exceeds 8000 chars nor contain any LOB fields. Furthermore the data is transferred between two tables that are bitwise...
0
1421
by: Derek Vincent | last post by:
Why am I having problems filling my dataset when I select fields of type varchar(350) from interbase? I can fill the dataset when I select every other field in the table but I receive and error message that says "object reference not set to an instance of an object" when I return the varchar field." The detailed error message is below. ...
3
2966
by: Khurram | last post by:
Hi, Firstly, I will apologise now if I have posted in the wrong discussion group. Please let me know if I have for future reference. Below is the code to a WebMethod that is querying an Access 2003 database, saving the results as a dataset and returning the dataset. public DataSet findAAPAssessment(string assessmentID) {
2
3826
by: rrflore2 | last post by:
Ok. I'm writing and deleting to an xml file using a dataset. I have a function in my codebehind page that binds a listbox to the dataset that performs the writes/deletes. Everything seems to be working fine except, I cannot get the listbox to update after the xml file is written to. I've tried to rebind the listbox and a bunch of other...
1
2353
by: jonbartlam | last post by:
Hi There I'm not sure what exactly is going wrong here. I'm writing an application that retreives a table from a database (tbl_internalfaults) and updates it. (Actually, just the status column will need updating with 'CLOSED' where necessary.) I have been trying to use the OLEDB command builder to build the statement to update the database...
4
22741
by: haarigee | last post by:
I need to insert without any parameters and execution query. Since, I have bulk of data's in a dataset the amount of transaction makes the application delay. So i need to directly insert my dataset to database table. DataSet FilecontentDataset = new DataSet(); String fileName = string.Empty; try { ...
0
7695
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...
0
8119
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...
1
7668
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...
0
7964
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...
0
6281
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...
0
5218
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...
0
3653
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...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
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.