Solved

xmlhttp timeout issue

Posted on 2004-08-11
7
4,069 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now