Error with XML DOM parsing the Request object

Discussion in 'ASP General' started by P James, Dec 28, 2005.

  1. P James

    P James Guest

    Hi,

    My project has been running for 4 years in ASP/IIS (originally on NT4, then
    on Win2003 as of 1 year ago), using the following code to parse the request
    object using the XML DOM:

    Set oASPRequest = GetObjectContext.Item("Request")
    Set oRequestDOM = CreateObject("MSXML.DOMDocument")
    If Not oRequestDOM.Load(oASPRequest) Then Err.Raise 64000, , "ASP
    Request object could not be parsed."

    ....and suddenly on 12/23 it started producing an error on the third line of
    code above.

    I'm not at work right now, so I can't get at the error information available
    from the DOM, so I will reply to this post with that information. I'm
    wondering if anyone knows what might be causing this to suddenly fail. I
    will be looking into what, if any, security hot-fixes were applied to the
    server recently.

    If anyone can shed any light on this, I would sincerely appreciate it.

    Thanks,
    PJ
     
    P James, Dec 28, 2005
    #1
    1. Advertising

  2. P James

    P Jamesen Guest

    Just wanted to add the error number that the parser is reporting in the
    ..parseError property: -2147467259 Google and MSDN Library don't seem to
    yield any useful information about this issue. So I'm still completely
    stumped. Any help is greatly appreciated.

    PJ


    "P James" <555.net> wrote in message
    news:...
    >
    > Hi,
    >
    > My project has been running for 4 years in ASP/IIS (originally on NT4,
    > then on Win2003 as of 1 year ago), using the following code to parse the
    > request object using the XML DOM:
    >
    > Set oASPRequest = GetObjectContext.Item("Request")
    > Set oRequestDOM = CreateObject("MSXML.DOMDocument")
    > If Not oRequestDOM.Load(oASPRequest) Then Err.Raise 64000, , "ASP
    > Request object could not be parsed."
    >
    > ...and suddenly on 12/23 it started producing an error on the third line
    > of code above.
    >
    > I'm not at work right now, so I can't get at the error information
    > available from the DOM, so I will reply to this post with that
    > information. I'm wondering if anyone knows what might be causing this to
    > suddenly fail. I will be looking into what, if any, security hot-fixes
    > were applied to the server recently.
    >
    > If anyone can shed any light on this, I would sincerely appreciate it.
    >
    > Thanks,
    > PJ
    >
    >
     
    P Jamesen, Dec 28, 2005
    #2
    1. Advertising

  3. P James wrote:
    > Hi,
    >
    > My project has been running for 4 years in ASP/IIS (originally on
    > NT4, then on Win2003 as of 1 year ago), using the following code to
    > parse the request object using the XML DOM:
    >
    > Set oASPRequest = GetObjectContext.Item("Request")
    > Set oRequestDOM = CreateObject("MSXML.DOMDocument")
    > If Not oRequestDOM.Load(oASPRequest) Then Err.Raise 64000, , "ASP
    > Request object could not be parsed."
    >
    > ...and suddenly on 12/23 it started producing an error on the third
    > line of code above.
    >
    > I'm not at work right now, so I can't get at the error information
    > available from the DOM, so I will reply to this post with that
    > information. I'm wondering if anyone knows what might be causing
    > this to suddenly fail. I will be looking into what, if any, security
    > hot-fixes were applied to the server recently.
    >
    > If anyone can shed any light on this, I would sincerely appreciate it.
    >
    > Thanks,
    > PJ


    Sorry, I'd like to help, but i have never seen this technique used in asp.
    What advantage do you gain by using this technique?

    I would suggest you be more explicit about your instantiation of the
    domdocument:
    Set oRequestDOM = CreateObject("MSXML2.DOMDocument")

    Also, use a parse error object to get information about any errors that
    occur during the parsing:

    bStatus= oRequestDOM.loadxml(oASPRequest)

    if bStatus = false then
    Set xPE = oRequestDOM.parseError
    strMessage = "errorCode = " & xPE.errorCode & vbCrLf
    strMessage = strMessage & "reason = " & xPE.reason & vbCrLf
    strMessage = strMessage & "Line = " & xPE.Line & vbCrLf
    strMessage = strMessage & "linepos = " & xPE.linepos & vbCrLf
    strMessage = strMessage & "filepos = " & xPE.filepos & vbCrLf
    strMessage = strMessage & "srcText = " & xPE.srcText & vbCrLf
    Err.Raise 64000,,strMessage
    exit sub
    end if

    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Dec 28, 2005
    #3
  4. P James

    P Jamesen Guest

    Thanks for the response. I followed both of your suggestions and
    unfortunately I still get the error. Here's what I get from the parseError
    object:

    ?o.errorCode
    -2147467259
    ?o.reason
    Unspecified error
    ?o.line
    0
    ?peo.linepos
    0
    ?peo.srctext
    <empty string>

    Still banging my head on it... Thanks for all insights!

    PJ



    "Bob Barrows [MVP]" <> wrote in message
    news:...
    >P James wrote:
    >> Hi,
    >>
    >> My project has been running for 4 years in ASP/IIS (originally on
    >> NT4, then on Win2003 as of 1 year ago), using the following code to
    >> parse the request object using the XML DOM:
    >>
    >> Set oASPRequest = GetObjectContext.Item("Request")
    >> Set oRequestDOM = CreateObject("MSXML.DOMDocument")
    >> If Not oRequestDOM.Load(oASPRequest) Then Err.Raise 64000, , "ASP
    >> Request object could not be parsed."
    >>
    >> ...and suddenly on 12/23 it started producing an error on the third
    >> line of code above.
    >>
    >> I'm not at work right now, so I can't get at the error information
    >> available from the DOM, so I will reply to this post with that
    >> information. I'm wondering if anyone knows what might be causing
    >> this to suddenly fail. I will be looking into what, if any, security
    >> hot-fixes were applied to the server recently.
    >>
    >> If anyone can shed any light on this, I would sincerely appreciate it.
    >>
    >> Thanks,
    >> PJ

    >
    > Sorry, I'd like to help, but i have never seen this technique used in asp.
    > What advantage do you gain by using this technique?
    >
    > I would suggest you be more explicit about your instantiation of the
    > domdocument:
    > Set oRequestDOM = CreateObject("MSXML2.DOMDocument")
    >
    > Also, use a parse error object to get information about any errors that
    > occur during the parsing:
    >
    > bStatus= oRequestDOM.loadxml(oASPRequest)
    >
    > if bStatus = false then
    > Set xPE = oRequestDOM.parseError
    > strMessage = "errorCode = " & xPE.errorCode & vbCrLf
    > strMessage = strMessage & "reason = " & xPE.reason & vbCrLf
    > strMessage = strMessage & "Line = " & xPE.Line & vbCrLf
    > strMessage = strMessage & "linepos = " & xPE.linepos & vbCrLf
    > strMessage = strMessage & "filepos = " & xPE.filepos & vbCrLf
    > strMessage = strMessage & "srcText = " & xPE.srcText & vbCrLf
    > Err.Raise 64000,,strMessage
    > exit sub
    > end if
    >
    > Bob Barrows
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
     
    P Jamesen, Dec 28, 2005
    #4
  5. I inadvertantly said you should use loadxml instead of Load (copy-and-paste
    issue) You didn't change "Load" to "LoadXML" did you? LoadXML expects a
    string argument. oASPRequest is an object, not a string (does this object
    have a ToString() method?)


    P Jamesen wrote:
    > Thanks for the response. I followed both of your suggestions and
    > unfortunately I still get the error. Here's what I get from the
    > parseError object:
    >
    > ?o.errorCode
    > -2147467259
    > ?o.reason
    > Unspecified error
    > ?o.line
    > 0
    > ?peo.linepos
    > 0
    > ?peo.srctext
    > <empty string>
    >
    > Still banging my head on it... Thanks for all insights!
    >
    > PJ
    >
    >
    >
    > "Bob Barrows [MVP]" <> wrote in message
    > news:...
    >> P James wrote:
    >>> Hi,
    >>>
    >>> My project has been running for 4 years in ASP/IIS (originally on
    >>> NT4, then on Win2003 as of 1 year ago), using the following code to
    >>> parse the request object using the XML DOM:
    >>>
    >>> Set oASPRequest = GetObjectContext.Item("Request")
    >>> Set oRequestDOM = CreateObject("MSXML.DOMDocument")
    >>> If Not oRequestDOM.Load(oASPRequest) Then Err.Raise 64000, , "ASP
    >>> Request object could not be parsed."
    >>>
    >>> ...and suddenly on 12/23 it started producing an error on the third
    >>> line of code above.
    >>>
    >>> I'm not at work right now, so I can't get at the error information
    >>> available from the DOM, so I will reply to this post with that
    >>> information. I'm wondering if anyone knows what might be causing
    >>> this to suddenly fail. I will be looking into what, if any,
    >>> security hot-fixes were applied to the server recently.
    >>>
    >>> If anyone can shed any light on this, I would sincerely appreciate
    >>> it. Thanks,
    >>> PJ

    >>
    >> Sorry, I'd like to help, but i have never seen this technique used
    >> in asp. What advantage do you gain by using this technique?
    >>
    >> I would suggest you be more explicit about your instantiation of the
    >> domdocument:
    >> Set oRequestDOM = CreateObject("MSXML2.DOMDocument")
    >>
    >> Also, use a parse error object to get information about any errors
    >> that occur during the parsing:
    >>
    >> bStatus= oRequestDOM.loadxml(oASPRequest)
    >>
    >> if bStatus = false then
    >> Set xPE = oRequestDOM.parseError
    >> strMessage = "errorCode = " & xPE.errorCode & vbCrLf
    >> strMessage = strMessage & "reason = " & xPE.reason & vbCrLf
    >> strMessage = strMessage & "Line = " & xPE.Line & vbCrLf
    >> strMessage = strMessage & "linepos = " & xPE.linepos & vbCrLf
    >> strMessage = strMessage & "filepos = " & xPE.filepos & vbCrLf
    >> strMessage = strMessage & "srcText = " & xPE.srcText & vbCrLf
    >> Err.Raise 64000,,strMessage
    >> exit sub
    >> end if
    >>
    >> Bob Barrows
    >>
    >> --
    >> Microsoft MVP - ASP/ASP.NET
    >> Please reply to the newsgroup. This email account is my spam trap so
    >> I don't check it very often. If you must reply off-line, then remove
    >> the "NO SPAM"


    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Dec 28, 2005
    #5
  6. P James wrote:
    > Hi,
    >
    > My project has been running for 4 years in ASP/IIS (originally on
    > NT4, then on Win2003 as of 1 year ago), using the following code to
    > parse the request object using the XML DOM:
    >
    > Set oASPRequest = GetObjectContext.Item("Request")
    > Set oRequestDOM = CreateObject("MSXML.DOMDocument")
    > If Not oRequestDOM.Load(oASPRequest) Then Err.Raise 64000, , "ASP
    > Request object could not be parsed."
    >
    > ...and suddenly on 12/23 it started producing an error on the third
    > line of code above.
    >
    > I'm not at work right now, so I can't get at the error information
    > available from the DOM, so I will reply to this post with that
    > information. I'm wondering if anyone knows what might be causing
    > this to suddenly fail. I will be looking into what, if any, security
    > hot-fixes were applied to the server recently.
    >
    > If anyone can shed any light on this, I would sincerely appreciate it.
    >
    > Thanks,
    > PJ


    Oh wait - you're doing this in a COM+ object? You should go to a more
    relevant newsgroup: one of the vb groups I would think ...

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Dec 28, 2005
    #6
  7. P James

    P Jamesen Guest

    Hi,

    Thanks for the insights. Turns out it was code elsewhere that interrogated
    the asp request object's form fields. Apparently after you do that, you can
    no longer have the xml dom's load method take the asp request object as
    input. When I removed the code that examined the request.forms collection,
    the code below that parses the request began to work again. Very strange,
    to me at least.

    Thanks for the troubleshooting tips.

    PJ




    "Bob Barrows [MVP]" <> wrote in message
    news:...
    >P James wrote:
    >> Hi,
    >>
    >> My project has been running for 4 years in ASP/IIS (originally on
    >> NT4, then on Win2003 as of 1 year ago), using the following code to
    >> parse the request object using the XML DOM:
    >>
    >> Set oASPRequest = GetObjectContext.Item("Request")
    >> Set oRequestDOM = CreateObject("MSXML.DOMDocument")
    >> If Not oRequestDOM.Load(oASPRequest) Then Err.Raise 64000, , "ASP
    >> Request object could not be parsed."
    >>
    >> ...and suddenly on 12/23 it started producing an error on the third
    >> line of code above.
    >>
    >> I'm not at work right now, so I can't get at the error information
    >> available from the DOM, so I will reply to this post with that
    >> information. I'm wondering if anyone knows what might be causing
    >> this to suddenly fail. I will be looking into what, if any, security
    >> hot-fixes were applied to the server recently.
    >>
    >> If anyone can shed any light on this, I would sincerely appreciate it.
    >>
    >> Thanks,
    >> PJ

    >
    > Oh wait - you're doing this in a COM+ object? You should go to a more
    > relevant newsgroup: one of the vb groups I would think ...
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
     
    P Jamesen, Dec 29, 2005
    #7
    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. Replies:
    0
    Views:
    581
  2. Greg Wogan-Browne
    Replies:
    1
    Views:
    879
    Uche Ogbuji
    Jan 28, 2005
  3. Rashida
    Replies:
    2
    Views:
    250
    Rashida
    Sep 16, 2004
  4. Erik Wasser
    Replies:
    5
    Views:
    524
    Peter J. Holzer
    Mar 5, 2006
  5. ming
    Replies:
    2
    Views:
    233
Loading...

Share This Page