Solved

xmlhttp timeout issue

Posted on 2004-08-11
7
4,099 Views
Last Modified: 2008-01-09
I am using Microsoft.xmlhttp to send a post to authorize.net for payment processing.  We have been seeing intermittent problems where we don't seem to recieve a response from the processor.  While this has worked perfectly for a year up until about a month ago, they are telling me that it's a timeout issue on our end.  What I'm trying to find out is whether I need to set a Server.scriptTimeout in the file, or if there is a timeout setting within the xmlhttp post that I need to be setting or both.

Any ideas?

This is the post/send portion of our script:
'Send the transaction data as part of the querystring
set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.open "POST", "https://secure.authorize.net/gateway/transact.dll?" & FINK, false
xml.send ""
                  
If xml.Status <> 200 Then Call ErrorConnecting
strRetval = xml.responseText
set xml = nothing

Sharpnet
0
Comment
Question by:sharpnet
  • 4
  • 3
7 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 11776380
>>or if there is a timeout setting within the xmlhttp post that I need to be setting or both.<<
None that I know of, but there is with the ServerXMLHTTP component, that you should be using in any case.  The method is called "setTimeouts".  See here for more info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xmmthsetTimeoutsMethod.asp
0
 
LVL 3

Author Comment

by:sharpnet
ID: 11776441
but that's using an active x object right?  I'm not using active x. nor am I using msxml.  can you clarify a bit more?  Why should I be using this and how would it be used in conjunction with the code I offered as an example?
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 11776550
>>but that's using an active x object right?  I'm not using active x. nor am I using msxml. <<
It is part of MSXML and has been since v 3 (I believe)

>>Why should I be using this and how would it be used in conjunction with the code I offered as an example?<<
Read up on the link I posted and on the ServerXMLHTTP as well:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xmobjxmldomserverxmlhttp.asp

Specifically, this section:
<quote>
The ServerXMLHTTP object offers functionality similar to that of the XMLHTTP object. Unlike XMLHTTP, however, the ServerXMLHTTP object does not rely on the WinInet control for HTTP access to remote XML documents. ServerXMLHTTP uses a new HTTP client stack. Designed for server applications, this server-safe subset of WinInet offers the following advantages:

Reliability — The HTTP client stack offers longer uptimes. WinInet features that are not critical for server applications, such as URL caching, auto-discovery of proxy servers, HTTP/1.1 chunking, offline support, and support for Gopher and FTP protocols are not included in the new HTTP subset.
Security — The HTTP client stack does not allow a user-specific state to be shared with another user's session. ServerXMLHTTP provides support for client certificates.
</quote>

Also, please maintain these old open questions:
1 07/01/2004 250 Text file save problem  Open Active Server Pages (ASP)
2 06/10/2004 125 Ad rotator in Windows application?  Open C#
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 3

Author Comment

by:sharpnet
ID: 11776717
sorry that I'm sounding uneducated, but that's a lot of techno-babble to me as I happen to be learning a lot of this.  Are you suggesting I replace the code I have with the msxml code in this link?  How do I know if the component is installed?
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 250 total points
ID: 11780409
>>but that's a lot of techno-babble to me<<
See if this make more sense:
Time-Outs in XMLHTTP, and Controls with a View
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaskdr/html/askgui05012001.asp
But simply put: If you are going from server to server (as you are) you should use the ServerXMLHTTP component.

>>Are you suggesting I replace the code I have with the msxml code in this link? <<
Yes.

>>How do I know if the component is installed?<<
You will know, as otherwise you will get something like "can't create object".  If that is the case (and I doubt it), you can download version 4 sp2 from here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42&DisplayLang=en

To put it another way, in the time that it took you to compose your last message you could have tested it and answered your own question:

set xml = Server.CreateObject("Msxml2.ServerXMLHTTP")
xml.SetTimeout a, b, c, d            ' Where a, b, c and d are the appropriate values
xml.open "POST", "https://secure.authorize.net/gateway/transact.dll?" & FINK, false
xml.send
               
If xml.Status <> 200 Then Call ErrorConnecting
strRetval = xml.responseText
set xml = nothing
0
 
LVL 3

Author Comment

by:sharpnet
ID: 11784939
Thanks.  I know I could have but since it's a live site I wanted as much info as possible.  Thanks for your patience and help.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 11784972
>>I know I could have but since it's a live site I wanted as much info as possible. <<
And I would never suggest you use code in a production site without testing.  

I trust all is going well and thank for the points.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question