By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,490 Members | 3,266 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,490 IT Pros & Developers. It's quick & easy.

Create XML Doc from XML returned by URL

P: n/a
BLH
Hi,

I am using a 3rd party product that returns XML when
calling its exe through a URL. For instance, the
following URL calls this exe in Internet Explorer and
returns valid, well formed XML and displays it in the
browser:

http://server/app/livelink.exe?
func=search&where1=report&outputformat=xml

My goal: I want to send this http request in VB.NET code,
in ASP.NET and store the XML that is returned in an XML
document.

So, my general question is: How can I store the XML
returned by an http request, in an XML Document?

Thanks in Advance,
BLH
Nov 11 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
You can store it in an xml document if that is what you will need to do with
it.

if you are just going to store it in a database or drive, just use a string.

you can just use the response.GetResponseStream() of the HttpWebResponse

and pass it into the Load method of the XmlDocument.

XmlDocument doc = new XmlDocument();
doc.Load(response.GetResponseStream())

be careful, if it is not valid xml, it can throw an error.

--
Joe Feser [Xml MVP]
http://www.fesersoft.com/
..Net, XML, XSLT, SQL
Free Code, Articles and Information.
"BLH" <bl*@rtp.com> wrote in message
news:0a****************************@phx.gbl...
Hi,

I am using a 3rd party product that returns XML when
calling its exe through a URL. For instance, the
following URL calls this exe in Internet Explorer and
returns valid, well formed XML and displays it in the
browser:

http://server/app/livelink.exe?
func=search&where1=report&outputformat=xml

My goal: I want to send this http request in VB.NET code,
in ASP.NET and store the XML that is returned in an XML
document.

So, my general question is: How can I store the XML
returned by an http request, in an XML Document?

Thanks in Advance,
BLH

Nov 11 '05 #2

P: n/a
BLH
Thanks for the reply Joe. Unfortunately, the exe that is
returning the XML must be doing things a bit strangely.

When I actually stream the contents of GetResponseStream()
to a file, instead of the actual XML, I get the following:

<HTML>
<!-- File: redirectmeta.html -->
<HEAD>
<TITLE>Livelink - Redirection</TITLE>
<META HTTP-EQUIV="Refresh" CONTENT="0;
URL=/us_ll9103tst/livelink.exe?
func=search&amp;lookfor1=allwords&amp;where1=repor t&amp;out
putformat=xml">
</HEAD>
</HTML>
<!-- End File: redirectmeta.html -->

It seems as if the livelink.exe is going through a two
step process where it:

1) accepts the request and sends a redirection response.
2) whatever it redirects the request to processes the
request and sends the XML as the response.

I am getting the response for #1 above, which is the
redirection... I think.

Anyway, thanks for the reply.
BLH
-----Original Message-----
You can store it in an xml document if that is what you will need to do withit.

if you are just going to store it in a database or drive, just use a string.
you can just use the response.GetResponseStream() of the HttpWebResponse
and pass it into the Load method of the XmlDocument.

XmlDocument doc = new XmlDocument();
doc.Load(response.GetResponseStream())

be careful, if it is not valid xml, it can throw an error.

--
Joe Feser [Xml MVP]
http://www.fesersoft.com/
..Net, XML, XSLT, SQL
Free Code, Articles and Information.
"BLH" <bl*@rtp.com> wrote in message
news:0a****************************@phx.gbl...
Hi,

I am using a 3rd party product that returns XML when
calling its exe through a URL. For instance, the
following URL calls this exe in Internet Explorer and
returns valid, well formed XML and displays it in the
browser:

http://server/app/livelink.exe?
func=search&where1=report&outputformat=xml

My goal: I want to send this http request in VB.NET code, in ASP.NET and store the XML that is returned in an XML
document.

So, my general question is: How can I store the XML
returned by an http request, in an XML Document?

Thanks in Advance,
BLH

.

Nov 11 '05 #3

P: n/a
yes it is. For some reason they set up the site for a web browser, not a
service.

Is the status returned a 302?

--
Joe Feser [Xml MVP]
http://www.fesersoft.com/
..Net, XML, XSLT, SQL
Free Code, Articles and Information.
"BLH" <bl*@rtp.com> wrote in message
news:08****************************@phx.gbl...
Thanks for the reply Joe. Unfortunately, the exe that is
returning the XML must be doing things a bit strangely.

When I actually stream the contents of GetResponseStream()
to a file, instead of the actual XML, I get the following:

<HTML>
<!-- File: redirectmeta.html -->
<HEAD>
<TITLE>Livelink - Redirection</TITLE>
<META HTTP-EQUIV="Refresh" CONTENT="0;
URL=/us_ll9103tst/livelink.exe?
func=search&amp;lookfor1=allwords&amp;where1=repor t&amp;out
putformat=xml">
</HEAD>
</HTML>
<!-- End File: redirectmeta.html -->

It seems as if the livelink.exe is going through a two
step process where it:

1) accepts the request and sends a redirection response.
2) whatever it redirects the request to processes the
request and sends the XML as the response.

I am getting the response for #1 above, which is the
redirection... I think.

Anyway, thanks for the reply.
BLH
-----Original Message-----
You can store it in an xml document if that is what you

will need to do with
it.

if you are just going to store it in a database or drive,

just use a string.

you can just use the response.GetResponseStream() of the

HttpWebResponse

and pass it into the Load method of the XmlDocument.

XmlDocument doc = new XmlDocument();
doc.Load(response.GetResponseStream())

be careful, if it is not valid xml, it can throw an error.

--
Joe Feser [Xml MVP]
http://www.fesersoft.com/
..Net, XML, XSLT, SQL
Free Code, Articles and Information.
"BLH" <bl*@rtp.com> wrote in message
news:0a****************************@phx.gbl...
Hi,

I am using a 3rd party product that returns XML when
calling its exe through a URL. For instance, the
following URL calls this exe in Internet Explorer and
returns valid, well formed XML and displays it in the
browser:

http://server/app/livelink.exe?
func=search&where1=report&outputformat=xml

My goal: I want to send this http request in VB.NET code, in ASP.NET and store the XML that is returned in an XML
document.

So, my general question is: How can I store the XML
returned by an http request, in an XML Document?

Thanks in Advance,
BLH

.

Nov 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.