CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 28 of 28

Thread: Parsing SOAP XML with Classic ASP

  1. #16
    Join Date
    Aug 2016
    Posts
    15

    Re: Parsing SOAP XML with Classic ASP

    Quote Originally Posted by 2kaud View Post
    Which line is causing the error?
    Sorry, same line.

  2. #17
    Join Date
    Aug 2016
    Posts
    15

    Re: Parsing SOAP XML with Classic ASP

    Quote Originally Posted by Arjay View Post
    If objDoc.GetElementsByTagName("Status") doesn't find any objects, then attempting to access the first object in a list (with item(0)) is going to result in an error. You need to check if isSuccess is null and isSuccess.item is null (or has values).
    OK, I follow. How do you suggest I write that? Please keep in mind that this is not a language I'm used to dealing with, so the most specific answer possible would be most helpful.

  3. #18
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,121

    Re: Parsing SOAP XML with Classic ASP

    Which version of my suggestions in post #12 are you trying? If the first suggestion and the error line is still the one containing .GetElementsByTagName() then there is still an issue with .GetElementsByTagName().

    If you are using the second suggestion, then try using the first and see if the error moves to the if statement.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.6.1)

  4. #19
    Arjay's Avatar
    Arjay is online now Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,284

    Re: Parsing SOAP XML with Classic ASP

    Quote Originally Posted by Auciker View Post
    OK, I follow. How do you suggest I write that? Please keep in mind that this is not a language I'm used to dealing with, so the most specific answer possible would be most helpful.
    I don't code in this language either, but it's probably something like:
    Code:
    isSuccess = objDoc.getElementsByTagName("Status")
    ...
    If isSuccess = Null AND isSuccess.item(0).text = "Success" Then
    Not sure the syntax of how to check for null and do an AND statement, but that is the gist of it.

  5. #20
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,121

    Re: Parsing SOAP XML with Classic ASP

    A sister site to this one has a forum for ASP and VBScript. You might like to try posting there
    http://www.vbforums.com/forumdisplay...-ASP-VB-Script
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.6.1)

  6. #21
    Join Date
    Aug 2016
    Posts
    15

    Re: Parsing SOAP XML with Classic ASP

    Quote Originally Posted by 2kaud View Post
    Which version of my suggestions in post #12 are you trying? If the first suggestion and the error line is still the one containing .GetElementsByTagName() then there is still an issue with .GetElementsByTagName().

    If you are using the second suggestion, then try using the first and see if the error moves to the if statement.
    I've tried the first suggestion. Moving it to the second line won't work, as it has to get passed line 66 (fatal error line) to get to the "fixed" line on 68.

    Code:
    Microsoft VBScript runtime error '800a01a8'
    
    Object required: '[object]'
    
    /inc/verify.asp, line 66
    Line 66 currently reads:
    Code:
    isSuccess = objDoc.getElementsByTagName("Status").item(0).text

  7. #22
    Join Date
    Aug 2016
    Posts
    15

    Re: Parsing SOAP XML with Classic ASP

    Quote Originally Posted by Arjay View Post
    I don't code in this language either, but it's probably something like:
    Code:
    isSuccess = objDoc.getElementsByTagName("Status")
    ...
    If isSuccess = Null AND isSuccess.item(0).text = "Success" Then
    Not sure the syntax of how to check for null and do an AND statement, but that is the gist of it.
    The change you're recommending is on line 68, but the code stops at line 66.

  8. #23
    Join Date
    Aug 2016
    Posts
    15

    Re: Parsing SOAP XML with Classic ASP

    Quote Originally Posted by 2kaud View Post
    A sister site to this one has a forum for ASP and VBScript. You might like to try posting there
    http://www.vbforums.com/forumdisplay...-ASP-VB-Script
    I just did so, thanks for the direction!

  9. #24
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,121

    Re: Parsing SOAP XML with Classic ASP

    Try changing line 66 to
    Code:
    isSuccess = objDoc.getElementsByTagName("Status")
    Does the error move to a different line or stay on line 66?
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.6.1)

  10. #25
    Join Date
    Aug 2016
    Posts
    15

    Re: Parsing SOAP XML with Classic ASP

    Quote Originally Posted by 2kaud View Post
    Try changing line 66 to
    Code:
    isSuccess = objDoc.getElementsByTagName("Status")
    Does the error move to a different line or stay on line 66?
    I did try that early on, but it gave the following error:
    Code:
    Microsoft VBScript runtime error '800a01c2'
    
    Wrong number of arguments or invalid property assignment
    
    /inc/verify.asp, line 66
    I just tried it again with the same results.

  11. #26
    Arjay's Avatar
    Arjay is online now Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,284

    Re: Parsing SOAP XML with Classic ASP

    Quote Originally Posted by Auciker View Post
    The change you're recommending is on line 68, but the code stops at line 66.
    Fantastic, is objDoc null?

  12. #27
    Join Date
    Aug 2016
    Posts
    15

    Re: Parsing SOAP XML with Classic ASP

    Quote Originally Posted by Arjay View Post
    Fantastic, is objDoc null?
    No, it should exist and be carrying the value "Success". This is the case in the API client I have successfully tested. I set an If/Else statement that if it returns any answer that does not include
    Code:
    <Status>Success</Status>
    it is taken as a failed authentication and should redirect to the login#error page. This should include null.

  13. #28
    Arjay's Avatar
    Arjay is online now Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,284

    Re: Parsing SOAP XML with Classic ASP

    Quote Originally Posted by Auciker View Post
    No, it should exist and be carrying the value "Success". This is the case in the API client I have successfully tested. I set an If/Else statement that if it returns any answer that does not include
    Code:
    <Status>Success</Status>
    it is taken as a failed authentication and should redirect to the login#error page. This should include null.
    You need to check to make sure what you think is getting loaded into the DOM is actually getting loaded. Back up and write out the strReturn value to the screen before loading the xmldoc.

    Code:
    Response.Write "<p>" + strReturn + "</p>"
    Btw, I found a website where you can test script online. I was able to get something working in javascript, but not in VBScript. In fact, the VBScript samples on the site wouldn't work in my IE11 browser.

    See http://www.xmlfiles.com/dom/dom_access.asp

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)