vba XMLHTTP get xml from Content Server



I'm trying to recover the XML from Content Server from Opentext using url. This is part of the code I'm using. wURL is : http://ift.tt/1uMVErC.



Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
objXMLHTTP.Open "GET", wURL, False
objXMLHTTP.Send

xmldoc.Load objXMLHTTP.responseXML
Set xmlNodeList = xmldoc.getElementsByTagName("llnode")


I get this response :



?objXMLHTTP.responsetext =
<html><body onload="document.forms[0].submit()"><noscript><p><strong>Note:</strong> Since your
browser does not support JavaScript,you must press the Continue button once to proceed.</p>
</noscript><form action=wURL method="post"><div><input type="hidden" name="OTDSTicket" value="


I found out that if I go to the URL via IE prior to executing the function, it loads the XML just fine into xmlNodeList. I tried to automate the process with an IE object that navigate to the URL but it's not viable since I need to look through 500+ XML and eventually IE returns an automation error.


I think by going to the URL before I call my function, I somehow authenticate or create a connection and thus being able to load the XML. I would like to know if it is possible to recreate that authentication by code in a reliable way.


I also tried :



objXMLHTTP.Open "GET", wURL, False, myUserName, myPW


with my credentials but it didn't change anything. Thank you.


No comments:

Post a Comment