-
August 22nd, 2016, 10:38 AM
#16
Re: Parsing SOAP XML with Classic ASP
 Originally Posted by 2kaud
Which line is causing the error?
Sorry, same line.
-
August 22nd, 2016, 05:26 PM
#17
Re: Parsing SOAP XML with Classic ASP
 Originally Posted by Arjay
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.
-
August 23rd, 2016, 02:33 AM
#18
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++23 Compiler: Microsoft VS2022 (17.6.2)
-
August 23rd, 2016, 12:03 PM
#19
Re: Parsing SOAP XML with Classic ASP
 Originally Posted by Auciker
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.
-
August 23rd, 2016, 01:21 PM
#20
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++23 Compiler: Microsoft VS2022 (17.6.2)
-
August 23rd, 2016, 01:29 PM
#21
Re: Parsing SOAP XML with Classic ASP
 Originally Posted by 2kaud
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
-
August 23rd, 2016, 01:31 PM
#22
Re: Parsing SOAP XML with Classic ASP
 Originally Posted by Arjay
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.
-
August 23rd, 2016, 01:47 PM
#23
Re: Parsing SOAP XML with Classic ASP
 Originally Posted by 2kaud
I just did so, thanks for the direction!
-
August 23rd, 2016, 03:02 PM
#24
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++23 Compiler: Microsoft VS2022 (17.6.2)
-
August 23rd, 2016, 06:46 PM
#25
Re: Parsing SOAP XML with Classic ASP
 Originally Posted by 2kaud
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.
-
August 24th, 2016, 11:34 AM
#26
Re: Parsing SOAP XML with Classic ASP
 Originally Posted by Auciker
The change you're recommending is on line 68, but the code stops at line 66.
Fantastic, is objDoc null?
-
August 24th, 2016, 12:18 PM
#27
Re: Parsing SOAP XML with Classic ASP
 Originally Posted by Arjay
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.
-
August 24th, 2016, 09:29 PM
#28
Re: Parsing SOAP XML with Classic ASP
 Originally Posted by Auciker
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
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|