Solved

xmlhttp timeout issue

Posted on 2004-08-11
7
4,085 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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/…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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