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

XML Feed

Hello

I need to provide a live XML feed from my web application to a 3rd party.
The 3rd party needs data from our database in XML format which will be
fromatted & presented on a web page sort of an RSS scenario. The problem is
I'm not sure how to to provide a dynamic XML file, or rather the latest data
will be returned as XML to the 3rd party.

I'm assuming this is a good scenario for a web service, but have no clue
where to begin. If anyone has faced this before & could point me in the
right direction to read up on this, I would appreciate it.

TIA
Steve
Nov 19 '05 #1
2 1176
Hi Steve,

Yes, a Web service would be a good way to go to provide XML. Here's a quick
example of how you can return a dataset that is very usable XML by anyone
who knows that they are doing:

' filename: wsdata.asmx

<%@ WebService Language="vb" Codebehind="wsdata.asmx.vb"
Class="p4320work.wsdata" %>
'filename: wsdata.asmx.vb
Imports System.Web.Services

<System.Web.Services.WebService(Namespace :=
"http://tempuri.org/p4320work/wsdata")> _
Public Class wsdata
Inherits System.Web.Services.WebService

<WebMethod()> _
Public Function SendData() As DataSet
Return CreateDataSource()
End Function
Function CreateDataSource() As DataSet
Dim dt As New DataTable
Dim dr As DataRow
Dim ds As New DataSet
dt.Columns.Add(New DataColumn _
("IntegerValue", GetType(Int32)))
dt.Columns.Add(New DataColumn _
("StringValue", GetType(String)))
dt.Columns.Add(New DataColumn _
("CurrencyValue", GetType(Double)))
dt.Columns.Add(New DataColumn _
("Boolean", GetType(Boolean)))
Dim i As Integer
For i = 0 To 8
dr = dt.NewRow()
dr(0) = i
dr(1) = "Item " + i.ToString()
dr(2) = 1.23 * (i + 1)
dr(3) = (i = 4)
dt.Rows.Add(dr)
Next i
ds.Tables.Add(dt)
Return ds
End Function 'CreateDataSource
End Class

Ken
Microsoft MVP [ASP.NET]
Toronto
"Steve Peterson" <sp*******@nospam.com> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl...
Hello

I need to provide a live XML feed from my web application to a 3rd party.
The 3rd party needs data from our database in XML format which will be
fromatted & presented on a web page sort of an RSS scenario. The problem
is I'm not sure how to to provide a dynamic XML file, or rather the latest
data will be returned as XML to the 3rd party.

I'm assuming this is a good scenario for a web service, but have no clue
where to begin. If anyone has faced this before & could point me in the
right direction to read up on this, I would appreciate it.

TIA
Steve


Nov 19 '05 #2
Thanks Ken

I appreciate you taking the time to reply on Christmas!

Steve
"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:O5**************@TK2MSFTNGP14.phx.gbl...
Hi Steve,

Yes, a Web service would be a good way to go to provide XML. Here's a
quick example of how you can return a dataset that is very usable XML by
anyone who knows that they are doing:

' filename: wsdata.asmx

<%@ WebService Language="vb" Codebehind="wsdata.asmx.vb"
Class="p4320work.wsdata" %>
'filename: wsdata.asmx.vb
Imports System.Web.Services

<System.Web.Services.WebService(Namespace :=
"http://tempuri.org/p4320work/wsdata")> _
Public Class wsdata
Inherits System.Web.Services.WebService

<WebMethod()> _
Public Function SendData() As DataSet
Return CreateDataSource()
End Function
Function CreateDataSource() As DataSet
Dim dt As New DataTable
Dim dr As DataRow
Dim ds As New DataSet
dt.Columns.Add(New DataColumn _
("IntegerValue", GetType(Int32)))
dt.Columns.Add(New DataColumn _
("StringValue", GetType(String)))
dt.Columns.Add(New DataColumn _
("CurrencyValue", GetType(Double)))
dt.Columns.Add(New DataColumn _
("Boolean", GetType(Boolean)))
Dim i As Integer
For i = 0 To 8
dr = dt.NewRow()
dr(0) = i
dr(1) = "Item " + i.ToString()
dr(2) = 1.23 * (i + 1)
dr(3) = (i = 4)
dt.Rows.Add(dr)
Next i
ds.Tables.Add(dt)
Return ds
End Function 'CreateDataSource
End Class

Ken
Microsoft MVP [ASP.NET]
Toronto
"Steve Peterson" <sp*******@nospam.com> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl...
Hello

I need to provide a live XML feed from my web application to a 3rd party.
The 3rd party needs data from our database in XML format which will be
fromatted & presented on a web page sort of an RSS scenario. The problem
is I'm not sure how to to provide a dynamic XML file, or rather the
latest data will be returned as XML to the 3rd party.

I'm assuming this is a good scenario for a web service, but have no clue
where to begin. If anyone has faced this before & could point me in the
right direction to read up on this, I would appreciate it.

TIA
Steve

Nov 19 '05 #3

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

Similar topics

0
by: Kraft Bernhard | last post by:
Hallo list, I don't know if this is a apropriate Newsgroup for this thread but I found it via google and there are already some RSS question in here so I'm just asking: I have written a...
2
by: Brad Sanders | last post by:
Hello All, Thanks to Richard's answer to my last post I understand now what I have to do, but.. How do I put a Line Feed or a Form Feed into a text file? Looking throught the .net help it...
1
by: Steve | last post by:
I have a script that has been modified from one that I found on the internet to display RSS feeds in html. The script works fine for most RSS feeds but there are a number that it fails on with the...
6
by: affiliateian | last post by:
Total newbie here for this so please be patient. We manually update our XML feed when we publish an article on our website. Can we add a javascript tracking pixel (from phpadsnew) into the XML...
4
by: Florian Lindner | last post by:
Hello, I'm looking for python RSS feed parser library. Feedparser http://feedparser.org/ does not seem to maintained anymore. What alternatives are recommendable? Thanks, Florian
5
by: Ed Flecko | last post by:
Hi folks, I'm trying to figure out this whole RSS feed thing. I've created my .xml file to use for my feed, and my browsers "recognize" that I have an RSS feed, and you can subscribe, etc., etc....
1
by: paul.hester | last post by:
Hi all, I work for a classified-type site and am planning on having an RSS feed for each category. I understand the basics of RSS, but I can't decide how often to update each RSS feed. Each...
4
by: Blake Garner | last post by:
I'm looking for suggestions on how to approach generating rss feed ..xml files using python. What modules to people recommend I start with? Thanks! Blake
10
by: bhass | last post by:
From my other post I am making a simple program that creates an RSS feed with Python. Now when I run my program so far, I get errors. It says "something is not defined". The word something is...
2
jamwil
by: jamwil | last post by:
What's up guys. I'm having some issues... I've created a method as part of my lifestreaming class which takes an rss feed, and puts the data into a database... It's fairly simple... Check...
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?
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:
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
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
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
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.