Reply
Highlighted
Member
Posts: 3
Registered: ‎03-22-2010
Accepted Solution

Setting up ARB using ASP Classic

Does anyone know of any resources to get help setting up ARB using ASP Classic?  I keep getting errors regarding the XML submission.  The latest error is "Invalid at the top level of the document. Error processing resource..."  I am fairly confident that there are not errors in the XML, so there must be something in the submission or the retrieval of the response.

 

The only sample files provided show the XML, not how to submit it.  I need help posting XML.  I have coded ASP for years, but have never had to do XML before now.

 

Thanks for any help.


Accepted Solutions
Highlighted
Solution
Accepted by topic author dzarro
‎08-21-2015 01:58 AM
Member
Posts: 3
Registered: ‎03-22-2010

Re: Setting up ARB using ASP Classic

It turns out that I had three problems.  The authorization name was not correct.  The date format was not correct.  And I was not properly parsing the return XML.  I ended up hiring one of the certified developers to help me troubleshoot the problem.  He was willing to fix it for a reasonable price.  It wasn't very "broken" so it did not take much time.

 

Thanks for your responses and your help.

View solution in original post


All Replies
Highlighted
Trusted Contributor
Posts: 264
Registered: ‎09-10-2009

Re: Setting up ARB using ASP Classic

Greetings,

 

Please post a code sample on how you're parsing the xml document.

 

Thank You!

Highlighted
Member
Posts: 3
Registered: ‎03-22-2010

Re: Setting up ARB using ASP Classic

Thank you for looking at this.

 

This is the XML...

 

strXml = "<?xml version='1.0' encoding='utf-8'?>"
strXml = strXml & "<ARBCreateSubscriptionRequest xmlns='AnetApi/xml/v1/schema/AnetApiSchema.xsd'>"
strXml = strXml & "<merchantAuthentication>"
strXml = strXml & "<name>ACC Test</name>"
strXml = strXml & "<transactionKey>" & strTransKey & "</transactionKey>"
strXml = strXml & "</merchantAuthentication>"
strXml = strXml & "<refId>" & KID & "</refId>"
strXml = strXml & "<subscription>"
strXml = strXml & "<name>Cockapoo Find Member Subscription</name>"
strXml = strXml & "<paymentSchedule>"
strXml = strXml & "<interval>"
strXml = strXml & "<length>1</length>"
strXml = strXml & "<unit>months</unit>"
strXml = strXml & "</interval>"
strXml = strXml & "<startDate>" & date() & "</startDate>"
strXml = strXml & "<totalOccurrences>12</totalOccurrences>"
'strXml = strXml & "      <trialOccurrences>1</trialOccurrences>" & vbcrlf
strXml = strXml & "</paymentSchedule>"
strXml = strXml & "<amount>" & request.Form("amt2") & "</amount>"
'strXml = strXml & "    <trialAmount>0.00</trialAmount>" & vbcrlf
strXml = strXml & "<payment>"
strXml = strXml & "<creditCard>"
strXml = strXml & "<cardNumber>" & txtCCNum & "</cardNumber>"
strXml = strXml & "<expirationDate>" & txtCCExp & "</expirationDate>"
strXml = strXml & "</creditCard>"
strXml = strXml & "</payment>"
strXml = strXml & "<billTo>"
strXml = strXml & "<firstName>" & txtBillingFName & "</firstName>"
strXml = strXml & "<lastName>" & txtBillingLName & "</lastName>"
strXml = strXml & "<address>" & txtBillingAddress & "</address>"
strXml = strXml & "<zip>" & txtBillingZip & "</zip>"
strXml = strXml & "</billTo>"
strXml = strXml & "</subscription>"
strXml = strXml & "</ARBCreateSubscriptionRequest>"

 

---------------------

And this is the code that sends it.....

 

Set objXMLDOC = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
Set objXMLDOM = Server.CreateObject("Msxml2.DomDocument")
Set oNode = Server.CreateObject("Microsoft.XMLDOM")

'SET CALL TIMEOUTS
lResolve = 8 * 1000 'Timeout values are in milli-seconds
lConnect = 8 * 1000
lSend = 10 * 1000
lReceive = 10 * 1000
objXMLDOC.setTimeouts lResolve, lConnect, lSend, lReceive

'MAKE THE CALL
objXMLDOC.open "POST", post_url, False
objXMLDOC.setRequestHeader "Content-Type", "text/xml"
objXMLDOC.send(strXml)
objXMLDOM.async = false
objXMLDOM.LoadXML objXMLDOC.responseText
'set objXMLDOM = objXMLDOC.responseXML

'PROCESS THE CALL
If objXMLDOM.parseError.errorCode <> 0 Then 'parser error found
Response.Write "parser error found"
Else 'no parser error
'BEGIN CHECK FOR ERROR FROM Authorize.net
Set oNode = objXMLDOM.getElementsByTagName("*")
Response.Write "oNode length = " & oNode.length & "<br>"
If (Not oNode Is Nothing) Then
Response.Write oNode.item(0).text & "<br>"
Else
'PROCESS SUCCESSFUL CALL
Set oNode = objXMLDOM.getElementsByTagName("subscriptionId")
If (Not oNode Is Nothing) Then
Response.Write "subscriptionId returned" & "<br>"
else
Response.Write "subscriptionId not returned" & "<br>"
End If


'End If

'CLEAN UP EVERYTHING
Set objXMLDOC = Nothing
Set objXMLDOM = Nothing
Set oNode = Nothing

End If
End If

Highlighted
Trusted Contributor
Posts: 264
Registered: ‎09-10-2009

Re: Setting up ARB using ASP Classic

Greetings,

 

Please try processing the root node first. Seems like the DOM Parser can't find the subscriptionId element without processing the root element first.

 

ARBCreateSubscriptionResponse <-- Root Element
Highlighted
Solution
Accepted by topic author dzarro
‎08-21-2015 01:58 AM
Member
Posts: 3
Registered: ‎03-22-2010

Re: Setting up ARB using ASP Classic

It turns out that I had three problems.  The authorization name was not correct.  The date format was not correct.  And I was not properly parsing the return XML.  I ended up hiring one of the certified developers to help me troubleshoot the problem.  He was willing to fix it for a reasonable price.  It wasn't very "broken" so it did not take much time.

 

Thanks for your responses and your help.

Highlighted
Trusted Contributor
Posts: 264
Registered: ‎09-10-2009

Re: Setting up ARB using ASP Classic

Glad you were able to get it resolved.

 

Thanks!

Highlighted
Member
Posts: 1
Registered: ‎03-28-2011

Re: Setting up ARB using ASP Classic

Hi dear,

 

I think I will face same problem you had.

How did you accomplish your ARB with other's help?

Is it possilbe that the ARB can be done with in classic ASP?

Only language what I know it that ASP with some basic XML.

I need to integrate with my subscription website.

 

Give some your advice for the late comer with ASP.

 

Best,

David

Highlighted
Member
Posts: 1
Registered: ‎04-14-2011

Re: Setting up ARB using ASP Classic

Can you please share your working code with others. Thanks

Highlighted
Member
Posts: 4
Registered: ‎07-05-2012

Re: Setting up ARB using ASP Classic

hi all,

 

             how to implement Automated Recurring Billing (ARB)  on authorize.net using classic asp,

           Please help me any one

            

thanks

Kamal.S

Highlighted
All Star
Posts: 1,072
Registered: ‎08-17-2009

Re: Setting up ARB using ASP Classic

Hey Kamal.S,

 

You can check out our sample code page for some examples of AIM/SIM in ASP Classic. Then for more info on ARB, please have a look at our ARB guides. Hopefully this will help you out.

 

Thanks,

 

Michelle

Developer Community Manager