Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: MSXML 3 Replaced By MSXML6 - Help >Thread Next - Re: MSXML 3 Replaced By MSXML6 - Help Re: MSXML 3 Replaced By MSXML6 - HelpTo: NULL Date: 2/13/2009 9:26:00 AM Sorry to waste your time. It's a frickin' RS/IIS permissions problem (and my
xml parsing and error checking was not so great). But I would be interested
in how I could catch this error in the future (after 4 hours focusing on
XML - now probably another 4+ dealing with permissions
When I got a response back from the RS web services it was an html page (You
are not authorized to view this page. HTTP Error 401.2 - Unauthorized:
Access is denied due to server configuration. Internet Information Services
(IIS)), I was always looking for specific XSLPatterns (e.g. //ErrorCode) in
code like nodeObject = xmldoc.documentElement.selectSingleNode(xslPattern)
and expecting to get "nothing" back if the pattern was not found. See code
again below.
When I put in the code you suggested I get back an error "-2146697209:No
data is available for the requested resource." I would only get this back
when I returned "nothing" to trigger error reporting, but when I used the
"selectSingleNode" method I would get the previous "Object required:
'xmldoc.documentElement'" VBScript error. So, it appears that
selectSingleNode throws a vbscript error rather than returning nothing???
Any thoughts? And thanks again.
Function getNodeObject(theResponse, xslPattern)
'if using 6.0 HAVE to use XPath instead of XSLPatterns
'and would HAVE to include namespaces and prefixes in the xpath
'for nodes associated with namespaces
Dim xmldoc
set xmldoc = Server.CreateObject("MSXML2.DOMDocument.3.0")
xmldoc.async = False
xmldoc.load(theResponse)
errorMsg = xmldoc.parseError.errorCode & ":" & xmldoc.parseError.reason
'set getNodeObject = nothing
set getNodeObject =
xmldoc.documentElement.selectSingleNode(xslPattern)
set xmldoc = nothing
End Function
Function getNodeText(theResponse, xslPattern)
Dim node
set node = getNodeObject(theResponse, xslPattern)
if NOT (node is nothing) then
getNodeText = node.text
set node = nothing
else
getNodeText = errorMsg
end if
End Function
"Martin Honnen" <mahotrash@y...> wrote in message
news:ej8TWQejJHA.504@T......
> Don Miller wrote:
>
>> Function getNodeObject(theResponse, xslPattern)
>> 'if using 6.0 HAVE to use XPath instead of XSLPatterns
>> 'and would HAVE to include namespaces and prefixes in the xpath
>> 'for nodes associated with namespaces
>> Dim xmldoc
>> set xmldoc = Server.CreateObject("MSXML2.DOMDocument.3.0")
>
> Add an
> xmldoc.async = False
> here
>> xmldoc.load(theResponse)
> then check
> xmldoc.parseError.errorCode
> xmldoc.parseError.reason
> here
>
>
>
>
> --
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
