XMLHTTP Question

Results 1 to 2 of 2

Thread: XMLHTTP Question

  1. #1
    Join Date
    Dec 1969

    Default XMLHTTP Question

    All<BR><BR>Within the company I work for, we use an intranet that is set as everyone&#039;s default IE homepage using Group Policy.<BR>A section of this intranet homepage goes to our corporate web site and presents any active vacancies on the web site.<BR>This have caused a problem because our Internet access filtering software is constantly exceeding the number of concurrent users -i.e any user accessing the intranet homepage is counted as being on the Internet. In order to solve this I have been trying to ensure that the request for vacancies from the intranet homepage is passed through the proxy server as a defined/fixed user so that this concurrent user issue will be resolved.<BR><BR>In order to this this I have implemented the following ASP page<BR>---------------------<BR>&#060;%<BR> Response.Buffer = True<BR> Dim objXMLHTTP, xml<BR><BR> &#039; Create an xmlhttp object:<BR> Set xml = Server.CreateObject("Microsoft.XMLHTTP")<BR><BR> &#039; Opens the connection to the remote server.<BR> xml.Open "GET", "http://www.corporatewebsite.com/vacancies", False, "MYDOMAINvacanciesuser", "password"<BR> <BR> &#039; Actually Sends the request and returns the data:<BR> xml.Send<BR><BR> &#039;Display the HTML<BR> Response.Write xml.responseText<BR> <BR> Set xml = Nothing<BR>%&#062;<BR><BR>This is almost working - the request from the vacancies page is logged by vacanciesuser not the actual user opening the intranet page.<BR>The only issue is that http://www.corporatewebsite.com/vacancies uses a stylesheet so there is a request to http://www.corporatewebsite.com/stylesheet.css within the vacancies page - the request for this page is logged by the user opening the intranet page and not vacanciesuser. <BR><BR>Is there a better way of achieving what I need or some way to work around the CSS request?<BR><BR>Thanks in advance for any assistance.<BR><BR>Regards,<BR>Katherine

  2. #2
    Join Date
    Dec 1969

    Default Images will do the same..

    .. thing.<BR><BR>It&#039;s in how the corporate site has the URLs to those things defined. If they have the full URL (e.g. "http://www.corporatewebsite.com/stylesheet.css"), the browser&#039;s going to make the request that you&#039;re seeing.<BR><BR>However, if it&#039;s a relative URL (e.g. "/stylesheet.css"), the browser won&#039;t make the request to the corporatewebsite server. It will, however, make a request to your Intranet server for that specific file (e.g. http://intranet/stylesheet.css").<BR><BR>There are a couple of ways around this. The most simply, is to change the corporate website to use relative URLs and add the corporate website&#039;s elements to your Intranet server (e.g. the stylesheet.css).<BR><BR>If you can&#039;t change the corporate website, you could potentially do a replace on "http://www.corporatewebsite.com/" with "/corpwebsite/" and, again, add the corporate website&#039;s elements to your Intranet server.<BR><BR>Lastly, and this is what I&#039;d probably do... it&#039;s more work, but in my opinion, it&#039;s cleaner:<BR> - create an ASP on the corporate webserver that simply reads from the database and returns the data as an XML stream;<BR> - create an ASP page on your Intranet server that makes a request to the ASP/XML stream on the corporate webserver;<BR> - have the ASP page on your Intranet server format the data into an HTML page and display that to the user.<BR><BR>eggheadcafe.com has some of the basics for the last option I presented:<BR>http://www.eggheadcafe.com/articles/20010209.asp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts