Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Msxml2.DOMDocument Basic Authentication

From: "Chris Kennedy" <chrisknospam@------.--.-->
To: NULL
Date: 11/5/2005 3:57:00 PM
Got it working with

http.open "GET","http://www.test.co.uk/test.xml",false ,"un","pw"
http.send
set objXMLDocument = http.responseXML
Set http = nothing
Set objNodes = objXMLDocument.selectNodes("/export/row")


"Martin Honnen" <mahotrash@y...> wrote in message 
news:uXFamU93FHA.3588@T......
>
>
> Chris Kennedy wrote:
>
>> I am using the Msxml2.DOMDocument.3.0 object. Can it load from a remote 
>> url
>> and if so how do I specify basic autentication username and password.
>
> I don't think so but you can use Msxml2.XMLHTTP.3.0 (client-side) or 
> Msxml2.ServerXMLHTTP.3.0 (server-side) to do a HTTP GET request and the 
> open method has optional arguments for username and password e.g. instead 
> of calling
>   domDocument.load url
> you would do e.g.
>   Set HttpRequest = CreateObject("Msxml2.XMLHTTP.3.0")
>   HttpRequest.open "GET", url, asyncAsTrueOrFalse, _
>     "username", "password"
>   HttpRequest.send
> then you can process the response (if you pass False for a synchronous 
> request to the send method then you can process the response with code 
> after the send call, if you pass True for an asynchronous request to the 
> open method then you would need to set up an onreadystatechange handler 
> and process the response there).
>
> If XML is served by the response with Content-Type text/xml or 
> application/xml then HttpRequest.responseXML is automatically built as a 
> DOMDocument for your code to use.
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/ 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent