Professional Web Applications Themes

Using cfobject to call a dll - Coldfusion - Advanced Techniques

Hi all Hope someone can help me with this problem i have. I have created an online shop which is using an integrated payment gateway (cybersource for those who know it). To p your variables to it securely it uses a .dll that fires them off and you get a reply back saying if the transaction has gone through successfully or not. Thats the basics of it anyway. Now the problem i have is there is only asp code for it, so im trying to convert the asp to roughly similar CF. To do this ive done the following so ...

  1. #1

    Default Using cfobject to call a dll

    Hi all

    Hope someone can help me with this problem i have. I have created an online
    shop which is using an integrated payment gateway (cybersource for those who
    know it). To p your variables to it securely it uses a .dll that fires them
    off and you get a reply back saying if the transaction has gone through
    successfully or not. Thats the basics of it anyway.

    Now the problem i have is there is only asp code for it, so im trying to
    convert the asp to roughly similar CF. To do this ive done the following so
    far...

    In ASP it calls the dll e.g.

    dim oRequest
    set oRequest = Server.CreateObject( "CyberSourceWS.Hashtable" )

    Ive represented this in CF by...

    <cfobject type="com" action="create" class="CyberSourceWS.Hashtable"
    name="HashTable">

    This seems to work fine. Now the next part is to assign the variables within
    the dll with what you wish them to be. For example, in the ASP they do it by ...

    oRequest( "billTo_firstName" ) = "Tom" )

    I assume this finds the arguement in the dll called "billTo_firstName" and
    assigns the value Tom to it. This where i cant work out how to do the same
    within CF? Is this possible or am i barking up the wrong tree? Ive tried things
    such as

    <cfset HashTable.billTo_firstName("Tom")>

    But to no avail, as it comes back stating ..

    The selected method billTo_firstName was not found.
    There are no methods with the specified method name and argument types. Please
    check your function and try again.


    Any help would be extremely appreciative and i thank you all in advance

    Tom Jenkins

    tomarse Guest

  2. #2

    Default Re: Using cfobject to call a dll

    Hi Tom,

    You need to reformat the CFSET tag. You're invoking the name property as if
    it were a method:

    <cfset HashTable.billTo_firstName("Tom")>

    Try

    <cfset HashTable.billTo_firstName = "Tom">

    HTH,


    philh Guest

  3. #3

    Default Re: Using cfobject to call a dll

    unfortunately i still get the same error with your method : (

    This new way ive been looking at ...

    <cfset oRequest.value("ccAuthService_run","True")>

    seems to assign the value to the correct arguement but then if i make up an
    arguement such as <cfset oRequest.value("sdfsdfsdfsdf","True")> its still
    assigns, so im taking it that it hasnt worked

    : (

    tomarse Guest

  4. #4

    Default Re: Using cfobject to call a dll

    I think, but not sure, that your last approach is correct. Looks like this
    thing simply builds something like this:

    name=value&name=value&. . . .&. . .

    Therefore, any name and any value are OK. You will get error (or not) when
    you actually run the request. Just try...


    Mr Black Guest

  5. #5

    Default Re: Using cfobject to call a dll

    I don't know the exact terminology as it has been a couple years since I
    visited this topic, with Active-X/COM components their are three different
    threading models and I think two different definition formations (this is where
    I forget the terminology). When I was writing some components to work with CF,
    I found that CF only recognizes one fo these combinations (out of 6 possible)
    -- all the rest returned errors like you are seeing. At the time (and still to
    this day) I was working with CF5 and I have no idea if CFMX (et. al.) has the
    same limitation.

    Basically I saying, that unless they (CS) dedicate some time to fine tune the
    dll for CF, you may be fighting a losing battle. Hope this helps and good
    luck...

    Steve Sommers Guest

Similar Threads

  1. cfobject
    By djfletch in forum Coldfusion Server Administration
    Replies: 0
    Last Post: February 28th, 04:19 PM
  2. CFOBJECT error
    By loopthis! in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: June 14th, 04:27 PM
  3. CFObject with ASP Script
    By Radioactive45 in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: May 27th, 04:01 PM
  4. Problems with CFOBJECT
    By Rick in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: May 9th, 03:41 PM
  5. Using CfObject
    By Tom CF in forum Macromedia ColdFusion
    Replies: 5
    Last Post: April 7th, 05:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139