You can use a stream object to write the xml, you will have to add any
datarelation, constraints, etc. to get the relational structure you want.
Either way, it's probably a stream object that you'll need to research to
produce the results you want. If you are using one of your own webservices
create an "overloaded" method that accepts a dataset or an xmldocument
object - use the messagename attribute.
Dim sw As New System.IO.StringWriter
ds.WriteXml(sw, XmlWriteMode.IgnoreSchema)
sw.Flush()
Dim MyStr As String = sw.ToString
sw.Close()
MyService.MyMethod(myStr)
Jared
"Scott Lyon" <(E-Mail Removed)> wrote in message
news:Oa56o$(E-Mail Removed)...
> Quick question for you guys:
>
> First, let me tell you that I'm new to VB.NET (I've been programming
> VB6/ASP
> for years), so bear that in mind.
>
> I'm working on an application that needs to build XML based on data from a
> stored procedure (or procedures, as it may require multiple procedures),
> and
> needs to pass that XML as a string to a Web Service.
>
>
> Am I better off creating this XML using the XMLDOM that I've used in VB6,
> or
> is there a better/easier way to generate custom XML in VB.NET?
>
>
> At first I thought I could just dump a DataSet to XML using the WriteXML
> method, but at first glance it seems that writes it to a file, and I'd
> rather avoid the step of writing to a file, and then having to read it
> back
> into memory again to pass it to the Web Service. Not only that, but the
> XML
> I need to create is rather complex, with elements within elements within
> elements, and I've been unable to create the parent/child relationships
> between the elements.
>
> Then I thought I could use the XMLTextWriter class, but that too seems to
> write only to a file.
>
>
> Ideas/suggestions?
>
>
> Thanks!
>
>
|