Reading XML from a URL into a String using VB.NET

  • I currently have a small demo program.

    It is a VB.NET project.

    In this Program I hardcoded a string called XMLstr to an XML

    transaction.

    i.e.

    Dim XMLstr as String

    XMLstr = "<body><NAME>Joe Blow</NAME><ADRESS>123 Main Street</ADDRESS></body>" etc...

    ...

    I also setup a Virtual Directory capable of extracting data from a SQL 2K table into XML format.

    This URL is capable of creating output exactly the same as the above hardcoded XML transaction.

    i.e.

    http://myserver/getxml/

    produces the following output

    <body>

    <NAME>Joe Klien</NAME>

    <ADRESS>123 Main Street</ADDRESS>

    </body>

    ...

    Question.

    How can I load my string variable (XMLstr) with the output produced by my XML URL?

    i.e.

    XMLstr = someFunction("http://myserver/getxml")

    result: XMLstr = "<body><NAME>Joe Blow</NAME><ADRESS>123 Main Street</ADDRESS></body>".

    Thank you in advance for your help...

    Glenn Madine

    Systems Administrator

    TechSmart


    Glenn Madine
    Systems Administrator
    TechSmart

  • Not sure but the output should be a standard http response. I will try some things out and get back to you. The other thing you could do is instead of using the url to get the query you could create a stored procedure that uses the FOR XML clause to return the same data. Then you could return it as a recordset or as a parameter.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply