Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4154
  • Last Modified:

xmlhttp timeout issue

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
sharpnet
Asked:
sharpnet
  • 4
  • 3
1 Solution
 
Anthony PerkinsCommented:
>>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
 
sharpnetAuthor Commented:
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
 
Anthony PerkinsCommented:
>>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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
sharpnetAuthor Commented:
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
 
Anthony PerkinsCommented:
>>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
 
sharpnetAuthor Commented:
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
 
Anthony PerkinsCommented:
>>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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now