Archived Forum Post

Index of archived forum posts

Question:

Oauth woocommerce

Feb 28 '17 at 20:34

Hello,

I am trying to connect to woo commerce api with you dll. I am getting the following error -

Microsoft VBScript runtime error '800a01ad'

ActiveX component can't create object: 'Chilkat_9_5_0.Rest'

The code I have so far is below. I do currently use the ChilkatAx-9.5.0-x64.dll for decryption. I believe I downloaded that in February of 2016. Do I need to download the dll again? If so can I just copy it over the current dll or do I need to copy it and register it on my server?

Dim fso, outFile, glob, success, oauth1, rest
Set fso = CreateObject("Scripting.FileSystemObject")
'Set outFile = fso.CreateTextFile("output.txt", True)

'____________

'  The Chilkat API can be unlocked for a fully-functional 30-day trial by passing any
'  string to the UnlockBundle method.  A program can unlock once at the start. Once unlocked,
'  all subsequently instantiated objects are created in the unlocked state.
' 
'  After licensing Chilkat, replace the "Anything for 30-day trial" with the purchased unlock code.
'  To verify the purchased unlock code was recognized, examine the contents of the LastErrorText
'  property after unlocking.  For example:
set glob = CreateObject("Chilkat_9_5_0.Global")
success = glob.UnlockBundle("Anything for 30-day trial")
If (success <> 1) Then
    response.write glob.LastErrorText
End If

'  The LastErrorText can be examined in the success case to see if it was unlocked in
'  trial more, or with a purchased unlock code.
response.write glob.LastErrorText

'_________

'  Demonstrates how to do OAuth1 authentication for a Wordpress site using Woo Commerce.

'  This example requires the Chilkat API to have been previously unlocked.
'  See Global Unlock Sample for sample code.

'  Prepare an OAuth 1.0 object for use with the Chilkat REST API.
set oauth1 = CreateObject("Chilkat_9_5_0.OAuth1")
oauth1.ConsumerKey = "ck_fa3d53ffa353535353"
oauth1.ConsumerSecret = "cs_26a2ceb6420920492942"

'  The signature method can be HMAC-SHA1 or HMAC-SHA256
oauth1.SignatureMethod = "HMAC-SHA256"

'  The OauthUrl property will need to be updated each time a request is sent.
'  The domain here must match the domain passed to the Connect method (below).
'  The domain must be exact.  For example, "www.your-wordpress-site.com" vs. "your-wordpress-site.com".
'  One might work while the other does not..
oauth1.OauthUrl = "http://exhibitorparty.com/wc-api/v3/orders"

'  The OAuthMethod property will be set automatically when the REST request is sent.
'  Setting it here is not actually necessary.
oauth1.OauthMethod = "GET"

'  Generate an initial nonce so that Chilkat knows the desired size of the nonce.
success = oauth1.GenNonce(32)

set rest = CreateObject("Chilkat_9_5_0.Rest")

Accepted Answer

The "can't create object" could be caused if you're using an older version that was prior to when the Rest object was introduced. Try downloading and registering the very latest version of the Chilkat ActiveX from https://www.chilkatsoft.com/downloads_ActiveX.asp

(The Chilkat downloads were unavailable earlier today due to the Amazon S3 outage that affected much of the Internet.)


Answer

ActiveX component can't create object is an error you will get if the component isn't registered properly, or if you have a typo in the name of the object you are trying to create. I would try downloading the latest version of the library, and registering it.