Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Msxml2.DOMDocument Basic Authentication [Thread Next] Re: Msxml2.DOMDocument Basic AuthenticationTo: 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/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
