Issue With ServerXMLHTTP
I am trying to use ServerXMLHTTP to grab the HTTP Header from a page using the following code but it doesn't work.
<%
Response.Write "Output"
Set getPage = Server.CreateObject("MSXML2.ServerXMLHTTP")
getPage.Open "HEAD", "http://www.example.com", false
getPage.SetRequestHeader "Content-type", "text/html"
getPage.Send
Response.Write(getPage.responseText)
Set getPage = Nothing
%>
I want to use HEAD instead of GET in order to save bandwidth. I don't want to retrieve the full html of a page, just the HTTP header to know that a file exists:
HTTP/1.0 200 OK
or that a file is not found
HTTP/1.0 404 Not Found
This is for a link checker that I am writing. Does anyone know what I am doing wrong or does this object not recognise the HEAD parameter?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
ServerXMLHTTP
We use the following configuration on our development environment: Server - win2k spk4 Local Computer - win2k spk3 We use the following code on the server to access a page on the local IIS : Set objSrvHTTP = Server.CreateObject ("MSXML2.ServerXMLHTTP.4.0") strUrl = "http://" & strLocalComputer & "/maoz/ShowRecNum.asp" objSrvHTTP.open "GET", strUrl , false objSrvHTTP.send() lngRecNum= objSrvHTTP.responseText set objSrvHTTP = nothing When strLocalComputer contains the local computer name, we get the requested page. But if we use the IP address of the local computer we get the error : msxml4.dll (0x80072EE7) The server name or address could not be resolved. We manage to run the URL with the IP address from a browser on the server but not from a browser on the local computer. Any ideas ?
ServerXMLhttp
I have been reading these posts and I thought I may be able to use serverXMLhttp for my current problem. My company requires all of their divisions to use the same template for intranet sites. They (corp IT) changes this template often. I can use serverXMLhttp to read the their site and dsplay everything. My problem is the .js and .css include files they use. How can I get this info into the correct format in my page and change their relative image links so that I can use their images. I will have a few minor edits for links and one image change. I assume that can be done through Replace()
ServerXMLHTTP
I'm trying to use a ServerXMLHTTP connection in async mode to request Page2.asp from Page1.asp. Both pages are inside 2 different virtual directories with Windows Integrated Authentication but the user who requests Page2.asp is different from user has requested Page1.asp.The user of Page2.asp is IWAM_machine_name. If I use ServerXMLHttp in standard mode there is no problem.
ServerXMLHTTP
Am using MSXML4.0 serverXMLHTTP for communicating with a remote server. Using POST method of serverXMLHTTP to post a xml string but after calling send method its give "HTTP 1.1 405 method not allowed" in response status text.
ServerXMLHTTP And Impersonation
I've two Win2000 Advanced Server (ServerA and ServerB) both part of an Active Directory. The Active Directory Server is named ServerC. On ServerA I've published an asp page PageA.asp inside a virtual directory VirtuaA. On ServerB I've published an asp page PageB.asp inside a virtual directory VirtuaB. Inside both server I've installed Microsoft XML Parser 4.0 sp2 Both virtual directories have setted Windows Integrated Authentication. PageA.asp has to get PageB.asp using ServerXmlHttp object and to show its contents. When I try to get PageA.asp from any client part of the same active directory I obtain an error: I'm not authorized to get PageB.asp. I've tried to use every solution founded on previous posts: - proxycfg -d -p " " "*" on ServerA - flag "trust for delegation" on Active Directory Control Panel of ServerC - ASP instruction .setProxy 2, " ", "*" inside PageA.asp Every solutions have failed....
AspHTTP Vs ServerXMLHTTP
I've been experimenting with both ServerObjects' AspHTTP and Microsoft's ServerXMLHTTP to access IMail. They both work fine, except for one weird thing. To log in to IMail via login.cgi, it takes ServerXMLHTTP about 30 seconds. It takes AspHTTP about 1 second. Accessing any other IMail page, the two are virtually identical. But the login page is unacceptably long for ServerXMLHTTP. Here's the code I'm using:
ServerXMLHTTP Problem...
I use ServerXMLHTTP object in order to force download dialog in my .asp file... All my code is here: Code:
ServerXMLHTTP, Session And Cookies
I try to use ServerXMLHTTP object to get the session infomation from a remote webpage, but it always returns nothing. the follwoing is my code: *local.asp* url = "http://domain/remote.asp" set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP") xmlhttp.open "GET", url, false xmlhttp.send "" Response.write xmlhttp.responseText set xmlhttp = nothing *remote.asp* bLogin = Session("login") sUserName = Request.Cookies("username") Response.Write(nUserID & " " & sUserName) although the session and cookie are not blank, but I cannot received any info.
ServerXMLHTTP Uses 100% CPU For A Long Time
I'm trying to use ServerXMLHTTP on an ASP (not ASP.NET) page to retrieve large binary data from a remote server. When the request is large (more than a few megabytes), the ServerXMLHTTP page jumps to nearly 100% CPU utilization for an unusually long time. The remote server needs a few seconds to prepare the request, during which time the CPU seems OK. It seems that as soon as the data is ready to retrieve, the CPU usage jumps and remains that way until the data has all been copied to the requesting server. That takes way too long - about 35 seconds when requesting a 12 MB file over a gigabit Ethernet. I use ServerXMLHTTP hundreds of thousands of times daily on this same system on the same network, with absolutely no problem - but for smaller requests. There's something about the size of the request that makes it blow up. I saw some reports of older systems with this problem (Windows 2000), but I'm running IIS 6 on Windows Server 2003, SP1.
MSXML2.ServerXMLHTTP Not Giving Url
I have been using the following code to access a remote url, which works fine, but if the remote "geturl" does a redirect (as the page in this code does), I have know idea what the redirected url is. Page still displays, (including the html source code), but I cannot determine what the base href is (that is, I don't know the url of the page being displayed, since is is a redirected page). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <% geturl ="http://schoolbonus.com/partner.asp?mpid=460" dim objXML,displayText Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP") objXML.open "GET", geturl, False objXML.send displayText = objXML.responSetext %> <pre><%= Server.HTMLEncode(displayText) %></pre> ************************************************** <%= displayText%>
MSXML2.ServerXMLHTTP Question
I've used MSXML2.ServerXMLHTTP in ASP to write a link checker. It checks a list of URLs stored in a db and flags any websites/webpages that are down. Since I am only interested in whether the page is up or not and not in the actual HTML, I use HEAD instead or GET. Code: Set getPage = Server.CreateObject("MSXML2.ServerXMLHTTP") getPage.Open "HEAD", URL, false where getPage is my object, URL is the URL to check and I can also do Code: Set getPage = Server.CreateObject("MSXML2.ServerXMLHTTP") getPage.Open "HEAD", URL, false , username , password which checks the URL using the username and password supplied. Everything works as expected but my problem lies in the fact that the password is in plaintext in the ASP page. It is not good security practice to have an ASP page contain a username/password combo in plaintext. This means that if someone had file access to the ASP page (intranet) then they could see the username/password pair which we want to try and avoid. Does the HTTP standard only allow for username/passwords to be sent in plaintext?
MSXML2.ServerXMLHTTP And Sessions
I'm trying to integrate portions of a page on one domain into another domain. The goal is to use a rate calculator on the remote site to produce quotes on the main site. I have permission to do this. I'm using MSXML2.ServerXMLHTTP and it's working quite well except that I am unable to set a session cookie that seems to be required to generate a PDF on the remote site. I've tried passing the session cookie thru MSXML2.ServerXMLHTTP, but that doesn't work. I've tried setting a cookie using ASP but it seems that PDF generation on the remote site requires the session cookie from the remote domain. I've tried setting a cookie with the domain property set to the remote site but the cookie is never written. I think this is a security feature in the Http Session State. Is it possible to set a session cookie in MSXML2.ServerXMLHTTP with a remote host/domain? Can ASP be used to set a cookie with a domain other than the requesting domain? There seems to be a property to do this but I haven't been able to get it to work. Any other suggestions?
ServerXMLHTTP Requests On The Same Web Application
On server A I've a web application WA1. Inside WA1 there are a virtual directory VD1 and an ASP page named page1.asp. Inside VD1 there is another ASP page named page2.asp. page1.asp makes a ServerXMLHTTP requests for page2.asp. If Debugging Flags on WA1 are enabled the request seems to be blocked, if those flags are disabled everything seems to be ok. Is my problem really solved ?
ServerXMLHTTP Responsetext Error In XML
In my application I want to get an XML document through an url call with the serverXMLHTTP object. When I call the XML-file it validates as correct XML. Part of the XML it contains is below: <?xml version='1.0' encoding='ISO-8859-1' ?> <DOCUMENT><AUTHOR>Carr�</AUTHOR></DOCUMENT> Code:
ServerXMLHTTP And Double-byte Encoding
I am trying to use ServerXMLHTTP to post data containing Japanese characters, but the data posts as question marks, boxes or just random ascii characters. Here is the code I am using:
MSXML2.ServerXMLHTTP.3.0 Proxy Server
Consider the following simple function to get the contents of a remote URL: Function GetURL(str_URL) Set obj_XMLHTTP = Server.CreateObject ("MSXML2.ServerXMLHTTP.3.0") obj_XMLHTTP.Open "GET", str_URL, False, "", "" obj_XMLHTTP.Send GetURL = obj_XMLHTTP.ResponseText Set obj_XMLHTTP = Nothing End Function Is there anyway that I can use a remote proxy server to make the request?
MSXML2.ServerXMLHTTP Works Only With Text Files?
I'm trying to remotely get a pdf file - http://remoteServer/file.pdf - in order to store it into another server, maybe with Scripting.FileSystemObject However the following code doesn't work properly: ------------ url = "http://remoteServer/file.pdf" set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") xmlhttp.open "GET", url, false xmlhttp.send "" ------------ as xmlhttp.responseText does not contain the whole file textStream, but only a part of it.
ServerXMLHTTP Failing With Large Binary Files
I am trying to use ServerXMLHTTP in an ASP page to return a binary file download to the browser. It works just fine with small files ( under 1 MB) but seems to fail with large files (4 MB, 11 MB in tests). A success would be that the browser kicks off the "Save As" file dialog. The failures are not always the same. Sometimes the browser tries to download the ASP file itself. Sometimes the the file seems to download successfully, but for example only 1.6 MB of a 4 MB file are actually downloaded and it doesn't seem to be a simple truncation. Sometimes I get "internal server error 500". Below is my ASP code. "Project1.exe" is small enough to be successful. If you substitute "OmniViewProSetup.exe" (4 MBs) it will fail.....
Sharing Data Among Pages On Different Domains Using ServerXMLHTTP
I'm including the output of an .asp page hosted on other domain using serverXMLHTTP. Is it possible that I can share the values of some variables from external file. Like session or others like (suppose..) TablesBGColor = "#FFG445" TableHieght = "600" session("ImagesFolder") = "http://www.SiteABC/_images/" If i include the settings.asp file on the top of my asp page then How can i use the above mentioned variables/values down in my own ASP page.
MSXML2.ServerXMLHTTP Returning Status 500 When Accessing Webservice
The following shows when I call it locally. If you look at the URL that has http://localhost, this is the one I use when I call the ASP page from the same local server (self contained). When I want to call the remote server (the one that fails) I use the other URL has http://remote. I hope this helps.. Because the webservice is the same on both machines and I'm calling both machines the same, what would cause the remote machine to return that the Request form not recognized?
Powerful MS HTTP Request Component - Alternative To ServerXMLHTTP!
Having just "discovered" it myself, I thought I'd draw everyone's attention to the fact that the WinHTTP 5.x object (which is used behind the scenes by our good friend the ServerXMLHTTP object) can be used directly in scripts. This is useful because the ServerXMLHTTP object encapsulates XML-related functionality which is unnecessary for performing most simple HTTP requests, and thus by using the WinHTTP object directly you achieve higher performance, scalability, and reduced memory consumption... AND WinHTTP offers quite a few features that ServerXMLHTTP does not expose - including the ability to specify a proxy (and an exclusion list) from within the script (or to acquire them from Internet Explorer's settings), IPv6 support, and HTTPS/SSL support! For more information .....
MSXML2.ServerXMLHTTP Returning Status 500 When Accessing Webservice
I am trying to access a webservice to post some values via MSXML2.ServerXMLHttp The OS used is win2003 on both machines. When I access the local machine (A) which has the same service the call works great. When I access the other machine (B) that is on the same subnet, I get a Status of 500. Code:
Type Mismatch Calling Function From ServerXMLHTTP Event Handler
request.asp: <% response.buffer=true function managestatechange response.write("objXMLHTTP.readyState: " & objXMLHTTP.readyState & "<br/>" & vbCrLf) response.flush() end function dim objXMLHTTP, strForm strForm=request.form response.write("Sending:" & strForm & "<br/><br/>" & vbCrLf) set objXMLHTTP=CreateObject("MSXML2.ServerXMLHTTP") objXMLHTTP.Open "POST", "************", false objXMLHTTP.onreadystatechange = managestatechange objXMLHTTP.setRequestHeader "lastCached", now() objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" objXMLHTTP.send strForm response.write("Response: " & objXMLHTTP.responseText & "<br/>" & vbCrLf) set objXMLHTTP = nothing %> Result: Sending: CMN=wmdj3847WNSJ8383&Modi=0208&Pan=4444444444443333&ExpMnth=12&ExpYear=06&IssNo=&StarMnth=12&StarYr=04&CV2=123&PostCode=AB12CD&HouseNum=1&EmReq=1&Value=10&OrderNumber=GOL-2005-00000&IsoC=GBR objXMLHTTP.readyState: 1 Microsoft VBScript runtime error '800a000d' Type mismatch: 'managestatechange.onreadystatechange' request.asp, line 34 Why does it work once then fall over? What am I doing wrong?
ASP / XML Issue With IIS
We have an ASP file (listener.asp) that is used to process SOAP transactions on our web server. The ASP file uses XML Core Services to load an XML file into a DOM document variable. We process around 50,000 transactions a day using this process. We have been getting intermittent errors while trying to load the XML file. We typically receive between 3 and 20 errors a day. We have attempted many different fixes and we recently upgraded to XML Core Services 4.0. None of our attempts have been successful in resolving the issue. Here is an excerpt of the code that fails. Set oXMLDoc = Server.CreateObject ("Msxml2.DomDocument.4.0") oXMLDoc.async = false oXMLDoc.Load (strSchemaLocPhys) where strSchemaLocPhys is "C:InetpubwwwrootcbwapiprodCBWWorkflow.xml".
Issue With ASP And Win XP
We are using Microsoft Office Web Components 11.0 in our asp page to use Pivot Table component. It is running well on all OS except Windows XP. On Windows XP system the pivot table control is not displayed in ASP page. Am I missing something? Any workarounds?
IIS Issue
I am getting the following error: Unable to open web project 'DNCWebApp'. Unable to validate that the file path 'C:InetPubwwwrootSamplesDNCWebApp' matches the URL path 'http://localhost:/DNCWebApp'. A connection with the server could not be established. I have copied the samples directory to the wwwroot folder and created a virtual directory pointing to the DNCWebApp directory which is inside the Samples directory. When I try to open the csproj file I get the error mentioned above.
Cookies Issue
I have an application that when it loads, it checks for a cookie on the client side. If the cookie exists, it sets a variable on the specific ASP page for certain fields to be populated. Our problem is that some user sessions have data left over in cookies that are from a previous user session....
ASP/IIS Configuration Issue
I think this error that I am receiving is a simple one to resolve. Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified I have downloaded and installed the latest version of MDAC but the error remains. I am attempting to configure IIS on a different drive ( E:inetpubwwwroot, instead of c:inetputwwwroot ). Could it be that SQL, ASP and IIS just have trouble talking across multiple drives? ( I have sql installed on a third drive ).
CDO Issue With Badmail
Usually when I setup a web form with CDO I either set the "From" field in the email to either: 1. The email address of the person filling out the form, in which case user errors often result in the mail getting stuck in the badmail folder and not being sent 2. An alias for the client (like Join Bytes!) to guarantee that it gets delivered, but this is less convenient for the client as they can't just reply-to the message, they have to manually change the address (not a big deal, but annoying) Is there another way to guarantee that even with a bad "from" address scenario #1 will work every time? Or some other option I'm too dense to have realized?
ASP And Query Issue
I have an issue trying to render a report. The report comes from a submitted ASP page that exports into Excel. My data comes from a stored procedure. That data outputs a current rank, previous rank, dealer name, current total, previous total, difference of totals, and % of totals. For some reason though, the stored procedure has a loop hole somewhere. I am comparing Dealers sales from one year to the next. They are uniquely identified by the phone numbers. I am UNABLE to get dealers who did business in 2005 but currently have less than a $1 in sales for 2006. However, I do get dealers with sales in 2006 but no sales in 2005. Am I making any sense? Code:
Rs.GetRows Issue
Since I never user .GetRow, (because arrays drive me crazy) I thought I'd give it a shot with something I had to do, unfortunately I get several errors. Code:
AdUseClient Issue..
I do not see what I am missing from this partial code to return values from a SQL db and then eventually use paging with the recordset. It errors on the line with adUseClient. The error that is returned is... Object doesn't support this property or method: 'adUseClient' Code:
ASP Session Issue
We have recently upgraded to a Windows 2003 Standard Edition Server, running IIS 6.0 and have subsequently had some issues with our ASP sites. When the user logs in, it does not immediately recognize they are logged in (based on the session variable we set) and stays on the login page. Once you hit refresh then it shows the logged in interface. Furthermore, once they try and navigate the site, it timeout after maybe 5-15 seconds and brings them back to the login page. So for some reason the session variables are being eliminated prior to the timeout we have set, which is 30 minutes (set in IIS). I also set the Session.Timeout value directly in the script and that still has not solved the issue. All of our ASP sites were functioning correctly prior to the upgrade so this leads me to believe that it has to do with that. The only other significant software change was that we upgraded or Cold Fusion software from 4.5 to 6.1 (CFMX). While this should not be a factor I thought I would include it as another potential cause.
Money Issue
i have a field which has datatype as money when i add a value in it like 110.00 rsadd("Amount")=txtamount it comes like $110.00 which is right what i want to do is instead of $110.00 i want -$110.00 i tried like this rsadd("Amount")="-" & txtamount when it added it came like this ($110.00)
Storage Issue
I want to have a variable in wich I will store a date. this variable should be stored in a DataBase, because I want it to be in all my website pages and I don't want it to be erased after the web host starts over (that marks out application variables). The real problem here isn't were to store it, cause that's gotta be in a DB (I think), but how to store it. I don't want to make a whole table with one feild in it only for one row, thats total waste of place on my host.
Validation Issue
Im dynamically generating the contents of a form with details read from a text file and the names im assigning to the controls are also dynamic.[The Labels of the Control.] The problem now is that, i dont know how do validate these controls for the mandatory check!! [Is there any option to iterate the entire controls present in a form??]
Connection Issue
This website is running on IIS 6, SQL Server 7 back end, asp scripting. It has public and private areas, but uses the same connection scripting throughout the entire site. SET conn = server.createobject ("adodb.connection") conn.open Session("DSN") strUserID = request.form("txtUserID") SET rsUserCheck = Server.CreateObject("ADODB.Recordset") rsUserCheck.CursorLocation = 3 rsUserCheck.open "SELECT * FROM tblUSERS WHERE UserWebAuthorityLevel = 1 AND UserID = '" & strUserID & "'",conn From Global.asa: Session("DSN") = "dsn=AWS_SQL;uid=IUSR_Hurricane;pwd=<>;DATABASE=AWS_SQL;APP=ASP Script;Trusted_Connection=yes" Although thousands of users connect successfully using the above every day, 2 users are getting the following message when going to the page, even when using the correct UserID and password. The connection cannot be used to perform this operation. It is either closed or invalid in this context. The error references the line "rsUserCheck.open "SELECT ..." One of the users has a 3-computer home network, with 2 of the 3 computers logging on without a problem. The same is true within another network, where some work and others don't. Otherwise, the vast majority of users are having no problem whatsoever. Have you heard of this happening before? Is this an IIS issue?
Display Issue
i have a problem with a image displayed in pop up window i have a radio button and next to it some text which says View image when you click on view image a pop up window pops up and shows the image with my case i cant see the image i have the image in the folder can someone tell me whats wrong Code:
ASP Currency Issue
i have a textbox where a user enters a number when he submits that page i want to show the number entered as currency: say for example he entered 12 next page i want to show $12.00 i did this: txtprice=Cast(txtprice AS MONEY) but its throwing an error any idea how to work this out
ASP - Excel Issue
The following is the 5th line of my ASP page and while executing the page im getting the Set MyExcelChart = Server.CreateObject("Excel.Sheet") the following error!! Error Type: Server object, ASP 0177 (0x8001010A) The message filter indicated that the application is busy. /tpp/Dynamic/myexcelchart.asp, line 5 What should i do to proceed further??
<Backspace> Key Issue.
I created a full asp web application. I have most of the bugs worked out of it. However, when I turned it over to the end-users for testing they found a wierd situation, as end-users will, that I hadn't come across. When a users is filling in a form and they land on a dropdown box, if the user hits the <Backspace> key it takes them back one page. Since this is my first asp project and Im not that experiainced with web applications, I wasn't sure if this was really an issue. Since this doesn't happen when the user lands on any other control, text, check box, option button etc... Code:
Date Value Issue
I am trying to retrieve a count of booking entries made 30 days ago, below is the end of the query I am having problems with. dbo.booking_form.TimeOfBooking = DATEADD(day, -30, GetDate()) GROUP BY dbo.booking_form.TimeOfBooking") When I use the = sign the error reads Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. for the entry on the page (rsCash30("CountOfTimeOfBooking")) But I know the record exists
Date Issue
I have a field in the table which stores date and datatype is datetime name is Dept_Date for example the values in the field are like this 5/16/2005 9:11:13 AM now i have my code like this d="5/16/2005' Code: Set rs= Server.CreateObject("adodb.RecordSet") str ="SELECT * from Dept where Dept_Date='" & d & "'" rs.Open str, Conn, 2, 2
Date Issue...
Would anyone know how to format the year as the last two numbers? Like this - May 5, 05
Minor Issue
I have an asp page which posts a form (made up of fields with drop down lists) to itself. The page then queries a sql server database when the form is submitted and creates a table with the results below the original form. This all works fine. However, when a user submits the form and the page is reloaded with the results, I want the page to focus on the newly created table + results rather than the top of the page (form).I have tried using vbscript to get the page to focus on the table everytime the form is submitted but have had no success. Is there a way to make this work?
Printing Issue
I have this code on the page which displays a image. <a href="print.asp?id=<%=ID%>"><img src="/image/imglink.gif" border="0" /></a> When a person clicks on the image it opens up print.asp What i want to do is when a person clicks on the image i want to print the page print.asp i tried window.print but its not working can someone tell me what i am doing wrong
Exporting To CSV Issue
I am using a SQL 2000 server and am trying to export results from a query to a text file. The code is working, expect my CONTACTNAME field has a comma, and my export is splitting that into 2 columns when I only want it to be one. Code:
|