Thread: Cfhttp

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    1
    Rep Power
    0

    Unhappy Cfhttp


    am having trouble using the cfhttp tag even though i have used it before with no problem. i am just sending over some data and trying to read the return response, but it it sending back an error saying "Empty Request" as if no data was sent. i had to install software on my server that is used in this connection and you first have to reference the software by creating an object, which i think i am doing right. when i try to do this with asp, it works fine, but i want to use coldfusion since that is what i am familiar with and the whole site is programmed in. i have included the coldfusion code i am using as well as the ASP code that does work. i'm figuring if someone also know ASP they can see what i may be missing in my coldfusion code.

    thanks craig

    --------------------------------------------------------------------
    COLDFUSION CODE THAT DOES NOT WORK:

    <CFOBJECT TYPE="COM" ACTION="CREATE" NAME="ThinClient" CLASS="CMPC.CMPCRequest">

    <CFHTTP url="https://centineltest.cardinalcommerce.com/maps/txns.asp" method="post">
    <CFHTTPPARAM type="FormField" name="MsgType" value="cmpi_lookup">
    <CFHTTPPARAM type="FormField" name="Version" value="1.3">
    <CFHTTPPARAM type="FormField" name="ProcessorId" value="100">
    <CFHTTPPARAM type="FormField" name="MerchantId" value="200">
    <CFHTTPPARAM type="FormField" name="OrderNumber" value="1234">
    <CFHTTPPARAM type="FormField" name="RawAmount" value="5597">
    <CFHTTPPARAM type="FormField" name="PurchaseCurrency" value="840">
    <CFHTTPPARAM type="FormField" name="PAN" value="4000000000000002">
    <CFHTTPPARAM type="FormField" name="PANExpr" value="0504">
    </CFHTTP>


    <CFOUTPUT>

    Response - #CFHTTP.FileContent#

    </CFOUTPUT>
    ---------------------------------------------------------------------
    ASP CODE THAT WORKS:

    <%
    Set centinelRequest = Server.CreateObject("CMPC.CMPCRequest")

    centinelRequest.Add "MsgType","cmpi_lookup"
    centinelRequest.Add "Version","1.3"
    centinelRequest.Add "ProcessorId","100"
    centinelRequest.Add "MerchantId","200"
    centinelRequest.Add "OrderNumber","1234"
    centinelRequest.Add "RawAmount","5597"
    centinelRequest.Add "PurchaseCurrency","840"
    centinelRequest.Add "PAN","4000000000000002"
    centinelRequest.Add "PANExpr","0504"

    Set centinelResponse = centinelRequest.SendHTTP("https://centineltest.cardinalcommerce.com/maps/txns.asp")

    strEnrolled = centinelResponse.getValue("Enrolled")
    strAcsUrl = centinelResponse.getValue("ACSUrl")
    strPAReq = centinelResponse.getValue("Payload")
    strErrorNo = centinelResponse.getValue("ErrorNo")
    strErrorDesc = centinelResponse.getValue("ErrorDesc")
    strTransactionId = centinelResponse.getValue("TransactionId")

    Response.Write("Enrolled: ")
    Response.Write(strEnrolled)

    %>
    ---------------------------------------------------------------------
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,279
    Rep Power
    968
    I don't see how the CF code uses the COM object. Your ASP code is calling the add() method on the COM object proxy, but your CF code does nothing like this. Further, your ASP code is not posting a standard HTTP call, it is calling sendHTTP() on the COM object. I'm sure that is why it isn't working; the CF code never touches the COM object once it instantiates it.

IMN logo majestic logo threadwatch logo seochat tools logo