XML error: Illegal characters in path

Discussion in 'ASP .Net Web Services' started by MB, Jul 8, 2003.

  1. MB

    MB Guest

    Hi, I am using a web service to call an asp page on a remote server via
    System.Net.WebClient . The asp page returns a xml stream persisted from a
    recordset.

    I am having problems converting the stream into a valid xmltextreader
    document. I have also converted the document to the simple format without
    the DTD ( just plain xml file )
    and I still get the same error:

    Illegal characters in path.
    Exception Details: System.ArgumentException: Illegal characters in path.

    I have pasted to code below:

    <WebMethod(Description:="passsing ODBC sql str and DSN paramenters. Returns
    datatable")> _

    Public Function TestURL(ByVal strSQL As String, ByVal DSN As String) As
    datatable

    Dim web As New System.Net.WebClient
    Dim URL As String = "http://remote_server/query_legacy.asp"
    web.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
    Dim param1 As String = "strSQL=" & strSQL
    Dim param2 As String = "DSN=" & DSN

    Dim params As String = param1 & "&" & param2

    Dim bytparams As Byte() = BuildPostData(params)

    Dim res As Byte() = web.UploadData(URL, "POST", bytparams)

    Dim ds As New DataSet

    Dim str1 As String = System.Text.Encoding.ASCII.GetString(res)

    ==> ERROR RIGHT HERE: Dim stream_r As New StreamReader(str1)

    Dim xml_r As New System.Xml.XmlTextReader(stream_r)

    ds.ReadXml(xml_r)

    Return ds.Tables(1)

    End Function

    ------
    Any suggestions ?

    Thanks a lot in advance!
    MB
     
    MB, Jul 8, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve Grahovac
    Replies:
    1
    Views:
    8,838
    Jim Cheshire [MSFT]
    Jan 2, 2004
  2. Thomas
    Replies:
    1
    Views:
    2,150
    Tim_Mac
    Sep 6, 2006
  3. killkolor

    replace illegal xml characters

    killkolor, Mar 21, 2007, in forum: Python
    Replies:
    5
    Views:
    719
    Irmen de Jong
    Mar 21, 2007
  4. nexdeveloper

    Bad Request <OR> Illegal characters in path

    nexdeveloper, Oct 4, 2007, in forum: ASP .Net Security
    Replies:
    1
    Views:
    461
    Steven Cheng[MSFT]
    Oct 5, 2007
  5. Shirin

    Error: Illegal characters in path

    Shirin, Jun 4, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    171
    Shirin
    Jun 4, 2004
Loading...

Share This Page