473,405 Members | 2,349 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.

XML format / webservice / memorystream

Hi,
I'm new to webservices. I have created a small program to generate my XML
using webservices that works beautifully. Unfortunately I am unable to get
the XML output to be formatted in the necessary format. I've tried multiple
ways, including myXMLwriter. Any help would be greatly appreciated.

Thanks!

Desired Output (interfaces w/another program that I cannot change)
<?xml version="1.0" encoding="UTF-8" ?>
<datapacket>
<row PkFamily="1" Name="Sausage" />
<row PkFamily="2" Name="Sausages, salamis and fuet" />
<row PkFamily="3" Name="Stuffed pork loin" />
<row PkFamily="4" Name="Yorks: Pork hams and shoulders" />
<row PkFamily="5" Name="Poultry" />
</datapacket>

Result of my code:
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tri-mgroup.com/MyDataService/Service1">ÿþ<xml
xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'> <s:ElementType name='row' content='eltOnly'>
<s:AttributeType name='pkFamily' rs:number='1' rs:maydefer='true'
rs:writeunknown='true'> <s:datatype dt:type='int' dt:maxLength='4'
rs:precision='10' rs:fixedlength='true'/> </s:AttributeType> <s:AttributeType
name='name' rs:number='2' rs:nullable='true' rs:maydefer='true'
rs:writeunknown='true'> <s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType> <s:extends type='rs:rowbase'/> </s:ElementType>
</s:Schema> <rs:data> <z:row pkFamily='1' name='Sausage'/> <z:row
pkFamily='2' name='Sausages, salamis and fuet'/> <z:row pkFamily='3'
name='Stuffed pork loin'/> <z:row pkFamily='4' name='Yorks: Pork hams and
shoulders'/> <z:row pkFamily='5' name='Poultry'/> </rs:data> </xml></string>

Below is the code:
<WebMethod()> Public Function GetFamilyXML() As String
Dim myAdoRs As ADODB.Recordset
Dim myAdoConnection As New ADODB.Connection
Dim mypersiststream As New ADODB.Stream
Dim bLoaded As Boolean
Dim Result As String

Dim myConnectionString As String =
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
"C:\Program Files\Microsoft Office\Office10\Samples\catalog.mdb"
Dim mySelect As String = "SELECT family.pkFamily, family.name from
[family]"

myAdoConnection.ConnectionString = myConnectionString
myAdoConnection.Open()
myAdoRs = myAdoConnection.Execute(mySelect)
mypersiststream.Charset() = "iso8859-1"
mypersiststream.Open()
myAdoRs.Save(mypersiststream, ADODB.PersistFormatEnum.adPersistXML)
Return mypersiststream.ReadText
myAdoRs.Close()
End Function
Nov 12 '05 #1
0 1060

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

Similar topics

0
by: billb | last post by:
Hi all... I have a web method that doesvaildation but does not return just the xml from the invoke method, it retruns both the schema and the xml in the difgram .. The webmethod I'm using looks...
11
by: Andy | last post by:
Make the story short, I have a VB.NET client interface calling .NET webservice, written in VB.NET as well. I am trying to make the client as thin as possible so I let the webservice part to...
7
by: redraven | last post by:
Hi, I have a webservice with a method that returns an instance of System.IO.MemoryStream. For example: public MemoryStream myMeth() { return new MemoryStream();
7
by: Ohad Young | last post by:
Hi, I was wondering if it is possible to code a webservice that returns a picture? If so, How? Thanks in advance, Ohad
1
by: goodmannewz | last post by:
Could u please tell me why the following codes cannot run in webservice while these codes can be run in a window form? Thanks. The following is the error messge from IE:"HTTP 500 - Internal server...
1
by: jens Jensen | last post by:
Hello , i'm calling a webservice generated with oracle webservice java tools. I'm not able to add a web reference to a .net client the usual way with visual studio 2005. I was therefore...
3
by: RJA | last post by:
Hiyas, Using VS .net 2003. Setting up a Webservice that accepts 3rd party vendor designed XML requests and returns a filled XMLDocument with response data. Vendor XSDs were serialize into...
1
by: Peter Morris | last post by:
Hi all I would like my Pocket PC application (.NET Compact Framwork V2) to talk to a webservice, but the only port open on the server is 21 where an FTP server is sitting. I was wondering...
0
by: manjitsarma | last post by:
I need to display an image in 'Image Control' of aspx page.Now the image is displayed in the aspx page itself.But I need to display it in 'Image Control'.This is a map application and the image is...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.