473,405 Members | 2,445 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,405 software developers and data experts.

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 3398
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.Indented
xtw.Indentation = 2

xtw.QuoteChar = """"c

xtw.WriteStartDocument(True)

xtw.WriteComment("Data from db")

xtw.WriteStartElement("Data")

xtw.WriteStartElement("Employee")
Dim xtw As New Xml.XmlTextWriter(ms, System.Text.Encoding.UTF8)

xtw.WriteElementString("FirstName", "Evel")
xtw.WriteElementString("LastName", "Knievel")

xtw.WriteEndElement() 'closes the data node
xtw.WriteEndElement() 'closes the employee node

xtw.WriteEndDocument()

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.Indented
xtw.Indentation = 2

xtw.QuoteChar = """"c

xtw.WriteStartDocument(True)

xtw.WriteComment("Data from db")

xtw.WriteStartElement("Data")

xtw.WriteStartElement("Employee")
Dim xtw As New Xml.XmlTextWriter(ms, System.Text.Encoding.UTF8)

xtw.WriteElementString("FirstName", "Evel")
xtw.WriteElementString("LastName", "Knievel")

xtw.WriteEndElement() 'closes the data node
xtw.WriteEndElement() 'closes the employee node

xtw.WriteEndDocument()

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.XmlTextWriter(ms, System.Text.Encoding.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.Indented
xtw.Indentation = 2

xtw.QuoteChar = """"c

xtw.WriteStartDocument(True)

xtw.WriteComment("Data from db")

xtw.WriteStartElement("Data")

xtw.WriteStartElement("Employee")
Dim xtw As New Xml.XmlTextWriter(ms, System.Text.Encoding.UTF8)

xtw.WriteElementString("FirstName", "Evel")
xtw.WriteElementString("LastName", "Knievel")

xtw.WriteEndElement() 'closes the data node
xtw.WriteEndElement() 'closes the employee node

xtw.WriteEndDocument()

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
Unfortunately, I have not. But i can point you to some great references on
XSD schemas if you want them.

Scott

"Modica82" wrote:
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 #11
That would great. I think i was being a bit dim before, you can reference
the schema from anywhere, so as long as it is accessible on the web, you can
point you XML to use it, not sure how well that works for web services, but i
am sure i will find out soon enough.

Cheers!

Rob

"SQLScott" wrote:
Unfortunately, I have not. But i can point you to some great references on
XSD schemas if you want them.

Scott

"Modica82" wrote:
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 #12
Dev
if you are getting data from DataSet then dataset itself represent all data
in xml... n prob . u dont need to write your own parser

"Modica82" wrote:
That would great. I think i was being a bit dim before, you can reference
the schema from anywhere, so as long as it is accessible on the web, you can
point you XML to use it, not sure how well that works for web services, but i
am sure i will find out soon enough.

Cheers!

Rob

"SQLScott" wrote:
Unfortunately, I have not. But i can point you to some great references on
XSD schemas if you want them.

Scott

"Modica82" wrote:
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 #13
Hi Dev,

I know that the DataSet can pump out XML based on the data contained within
it, the problem with it is that it creates elements with names that are not
always particularly descriptive for third parties. We wanted a bit more
control over the XML so i am choosing to write it myself, that way we know
what we are sending across and can document the web service to tell third
parties what to expect, safe in the knowledge that they are recieving what we
intended to send them as set out in our documentation.

Regards,

Rob

"Modica82" wrote:
That would great. I think i was being a bit dim before, you can reference
the schema from anywhere, so as long as it is accessible on the web, you can
point you XML to use it, not sure how well that works for web services, but i
am sure i will find out soon enough.

Cheers!

Rob

"SQLScott" wrote:
Unfortunately, I have not. But i can point you to some great references on
XSD schemas if you want them.

Scott

"Modica82" wrote:
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 #14
Scott - Tried your code and it worked but when I call the HelloWorld function
from Cold Fusion I'm not getting data, just alot of numbers. I like this
idea and seems easy but how does the end user (consumer) see the correct data?

"Modica82" wrote:
Hi Dev,

I know that the DataSet can pump out XML based on the data contained within
it, the problem with it is that it creates elements with names that are not
always particularly descriptive for third parties. We wanted a bit more
control over the XML so i am choosing to write it myself, that way we know
what we are sending across and can document the web service to tell third
parties what to expect, safe in the knowledge that they are recieving what we
intended to send them as set out in our documentation.

Regards,

Rob

"Modica82" wrote:
That would great. I think i was being a bit dim before, you can reference
the schema from anywhere, so as long as it is accessible on the web, you can
point you XML to use it, not sure how well that works for web services, but i
am sure i will find out soon enough.

Cheers!

Rob

"SQLScott" wrote:
Unfortunately, I have not. But i can point you to some great references on
XSD schemas if you want them.

Scott

"Modica82" wrote:

> 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 #15
Hi Daniel,

What you are returning is an array of bytes that represent the file, what
you need to do is using the cold fusion file system objects (Not sure what
they are) and generate a file using the byte array provided. I am sorry if
this is a bit vague but i know nothing about cold fusion.

Regards,

Rob

"Daniel" wrote:
Scott - Tried your code and it worked but when I call the HelloWorld function
from Cold Fusion I'm not getting data, just alot of numbers. I like this
idea and seems easy but how does the end user (consumer) see the correct data?

"Modica82" wrote:
Hi Dev,

I know that the DataSet can pump out XML based on the data contained within
it, the problem with it is that it creates elements with names that are not
always particularly descriptive for third parties. We wanted a bit more
control over the XML so i am choosing to write it myself, that way we know
what we are sending across and can document the web service to tell third
parties what to expect, safe in the knowledge that they are recieving what we
intended to send them as set out in our documentation.

Regards,

Rob

"Modica82" wrote:
That would great. I think i was being a bit dim before, you can reference
the schema from anywhere, so as long as it is accessible on the web, you can
point you XML to use it, not sure how well that works for web services, but i
am sure i will find out soon enough.

Cheers!

Rob

"SQLScott" wrote:

> Unfortunately, I have not. But i can point you to some great references on
> XSD schemas if you want them.
>
> Scott
>
> "Modica82" wrote:
>
> > 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 #16
Modica - Have you successfully created any webservices that are being access
by non microsoft consumers? I've been following this post and would like to
see what others have done.

thanks.

"Modica82" wrote:
Hi Daniel,

What you are returning is an array of bytes that represent the file, what
you need to do is using the cold fusion file system objects (Not sure what
they are) and generate a file using the byte array provided. I am sorry if
this is a bit vague but i know nothing about cold fusion.

Regards,

Rob

"Daniel" wrote:
Scott - Tried your code and it worked but when I call the HelloWorld function
from Cold Fusion I'm not getting data, just alot of numbers. I like this
idea and seems easy but how does the end user (consumer) see the correct data?

"Modica82" wrote:
Hi Dev,

I know that the DataSet can pump out XML based on the data contained within
it, the problem with it is that it creates elements with names that are not
always particularly descriptive for third parties. We wanted a bit more
control over the XML so i am choosing to write it myself, that way we know
what we are sending across and can document the web service to tell third
parties what to expect, safe in the knowledge that they are recieving what we
intended to send them as set out in our documentation.

Regards,

Rob

"Modica82" wrote:

> That would great. I think i was being a bit dim before, you can reference
> the schema from anywhere, so as long as it is accessible on the web, you can
> point you XML to use it, not sure how well that works for web services, but i
> am sure i will find out soon enough.
>
> Cheers!
>
> Rob
>
> "SQLScott" wrote:
>
> > Unfortunately, I have not. But i can point you to some great references on
> > XSD schemas if you want them.
> >
> > Scott
> >
> > "Modica82" wrote:
> >
> > > 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 #17
Hi Daniel,

I am in the process of designing a web service wich will have to have a very
high level of interopability becuase it is going to be used on a cobol site
for starters. I have not implemented it so i cant vouch if my approach is
the best, but what i have done is different to the approach i started out
with here. What i am doing is desiging my messages (request and response) as
XML Schemas (XSD files) which i will then go onto generate my WDSL file from,
the link for the article i used is below. So instead of using XML as
strings, which actually get serialized differently to say an XML document,
which actually gets serialized as XML, i am going to pass back XML with
classes that will be generated from my Schema. I hope that makes sense.

http://msdn.microsoft.com/msdnmag/is...ervicesDesign/

Hope that helps,

Rob

"Daniel" wrote:
Modica - Have you successfully created any webservices that are being access
by non microsoft consumers? I've been following this post and would like to
see what others have done.

thanks.

"Modica82" wrote:
Hi Daniel,

What you are returning is an array of bytes that represent the file, what
you need to do is using the cold fusion file system objects (Not sure what
they are) and generate a file using the byte array provided. I am sorry if
this is a bit vague but i know nothing about cold fusion.

Regards,

Rob

"Daniel" wrote:
Scott - Tried your code and it worked but when I call the HelloWorld function
from Cold Fusion I'm not getting data, just alot of numbers. I like this
idea and seems easy but how does the end user (consumer) see the correct data?

"Modica82" wrote:

> Hi Dev,
>
> I know that the DataSet can pump out XML based on the data contained within
> it, the problem with it is that it creates elements with names that are not
> always particularly descriptive for third parties. We wanted a bit more
> control over the XML so i am choosing to write it myself, that way we know
> what we are sending across and can document the web service to tell third
> parties what to expect, safe in the knowledge that they are recieving what we
> intended to send them as set out in our documentation.
>
> Regards,
>
> Rob
>
> "Modica82" wrote:
>
> > That would great. I think i was being a bit dim before, you can reference
> > the schema from anywhere, so as long as it is accessible on the web, you can
> > point you XML to use it, not sure how well that works for web services, but i
> > am sure i will find out soon enough.
> >
> > Cheers!
> >
> > Rob
> >
> > "SQLScott" wrote:
> >
> > > Unfortunately, I have not. But i can point you to some great references on
> > > XSD schemas if you want them.
> > >
> > > Scott
> > >
> > > "Modica82" wrote:
> > >
> > > > 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 #18

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

Similar topics

0
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...
0
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...
1
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...
5
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...
1
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...
0
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...
3
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...
2
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...
1
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...
4
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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
0
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,...
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
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,...

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.