• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Coldfusion 10 problem with cfhttp postype xml

Community Beginner ,
May 09, 2014 May 09, 2014

Copy link to clipboard

Copied

We are making a cfhttp call.

We are submitting xml data. We are able to send information from server A to server B, but server B is not giving us any response.

Our code works for coldfusion 8 and 9 but it does not work for coldfusionh 10.

This is the snippet of the code

<cfhttp method="post" url="#httpURL#" timeout="3000" useragent="#CGI.http_user_agent#" >

    <cfhttpparam type="XML" value="#xmlRequest#" name="CLRCMRC_XML" >

</cfhttp>

The contents from server B can be access by

<cfdump var="#cfhttp.FileContent#">.

Note This works in coldfusion 8 and 9 but we are not getting any data from server B using coldfusion 10

Views

810

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , May 13, 2014 May 13, 2014

Issue solved.

It was a  matter of changing this line

<REQUEST KEY="#companykey#" PROTOCOL="0" FMT="1" ENCODING="0">

to use PROTOCOL="1"

Votes

Translate

Translate
Community Expert ,
May 11, 2014 May 11, 2014

Copy link to clipboard

Copied

Could you show us the structure of the URL and how you create the variable xmlRequest?

Assuming server B is also on ColdFusion, is it using getHttpRequestData().content to access the XML contents?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 12, 2014 May 12, 2014

Copy link to clipboard

Copied

The url is an https call

Below is the xml data being sent to the other server.

<cfxml variable = "xmlRequest">
    <cfoutput><REQUEST KEY="#companykey#" PROTOCOL="0" FMT="1" ENCODING="0">
        <TRANSACTION>
            <FIELDS>
                <TERMINAL_ID>#terminalID#</TERMINAL_ID>   
                <SERVICE_FORMAT>1010</SERVICE_FORMAT>                            <!--- 1010 = Card not present (E-commerce) --->
                <CURRENCY_CODE>124</CURRENCY_CODE>                                 <!--- 124 = Canadian currency code, 840 = us code --->
                <CURRENCY_INDICATOR>0</CURRENCY_INDICATOR>                        <!--- 0 = currency will be processed as a domestic currency transaction --->
                <TRANSACTION_INDICATOR>7</TRANSACTION_INDICATOR>                <!--- 7 = account information was received through a secure internet site --->                   
                <SERVICE>CC</SERVICE>                                            <!--- CC = Credit Card Transaction--->
                <SERVICE_TYPE>DEBIT</SERVICE_TYPE>                                <!--- DEBIT = CHARGE CC ACCOUNT HOLDER--->
                <SERVICE_SUBTYPE>SALE</SERVICE_SUBTYPE>                            <!--- Authorize and move funds from account holder to merchant--->
                <GOODS_INDICATOR>P</GOODS_INDICATOR>                            <!--- P = physical goods, as opposed to electronic goods --->                                   
                <PIN></PIN>
                <OPERATOR>Amazingclu</OPERATOR>                                 <!--- operator/location responsible for the transaction generation, in this case, the website--->
                <AMOUNT>8</AMOUNT>
                <ENTRY_MODE>3</ENTRY_MODE>                                        <!--- 3 = data was manually entered, no card/check present --->                       
                <CVV></CVV>
                <EXPIRATION></EXPIRATION>
                <ACCOUNT_NUMBER></ACCOUNT_NUMBER>
                <FIRST_NAME></FIRST_NAME>
                <LAST_NAME></LAST_NAME>
                <ADDRESS></ADDRESS>
                <CITY></CITY>
                <STATE></STATE>
                <POSTAL_CODE></POSTAL_CODE>
                <PHONE></PHONE>
                <COUNTRY></COUNTRY>
                <USER_DATA_0></USER_DATA_0>                                        <!--- optional field allowing us to send arbitrary transaction data --->
            <!---    <VERBOSE_RESPONSE>1</VERBOSE_RESPONSE>                         for testing purposes only --->
            </FIELDS>
        </TRANSACTION>
    </REQUEST></cfoutput>
</cfxml>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 12, 2014 May 12, 2014

Copy link to clipboard

Copied

I used your XML to run the following test. The test page uses cfhttp to post the XML to a CFC. It works as expected, returning the XML.

testPage.cfm

<cfset companykey="myKey123">

<cfset terminalID="ID123">

<cfxml variable = "xmlRequest">

    <cfoutput><REQUEST KEY="#companykey#" PROTOCOL="0" FMT="1" ENCODING="0">

        <TRANSACTION>

            <FIELDS>

                <TERMINAL_ID>#terminalID#</TERMINAL_ID>

                <SERVICE_FORMAT>1010</SERVICE_FORMAT>                            <!--- 1010 = Card not present (E-commerce) --->

                <CURRENCY_CODE>124</CURRENCY_CODE>                                 <!--- 124 = Canadian currency code, 840 = us code --->

                <CURRENCY_INDICATOR>0</CURRENCY_INDICATOR>                        <!--- 0 = currency will be processed as a domestic currency transaction --->

                <TRANSACTION_INDICATOR>7</TRANSACTION_INDICATOR>                <!--- 7 = account information was received through a secure internet site --->

                <SERVICE>CC</SERVICE>                                            <!--- CC = Credit Card Transaction--->

                <SERVICE_TYPE>DEBIT</SERVICE_TYPE>                                <!--- DEBIT = CHARGE CC ACCOUNT HOLDER--->

                <SERVICE_SUBTYPE>SALE</SERVICE_SUBTYPE>                            <!--- Authorize and move funds from account holder to merchant--->

                <GOODS_INDICATOR>P</GOODS_INDICATOR>                            <!--- P = physical goods, as opposed to electronic goods --->

                <PIN></PIN>

                <OPERATOR>Amazingclu</OPERATOR>                                 <!--- operator/location responsible for the transaction generation, in this case, the website--->

                <AMOUNT>8</AMOUNT>

                <ENTRY_MODE>3</ENTRY_MODE>                                        <!--- 3 = data was manually entered, no card/check present --->

                <CVV></CVV>

                <EXPIRATION></EXPIRATION>

                <ACCOUNT_NUMBER></ACCOUNT_NUMBER>

                <FIRST_NAME></FIRST_NAME>

                <LAST_NAME></LAST_NAME>

                <ADDRESS></ADDRESS>

                <CITY></CITY>

                <STATE></STATE>

                <POSTAL_CODE></POSTAL_CODE>

                <PHONE></PHONE>

                <COUNTRY></COUNTRY>

                <USER_DATA_0></USER_DATA_0>                                        <!--- optional field allowing us to send arbitrary transaction data --->

            <!---    <VERBOSE_RESPONSE>1</VERBOSE_RESPONSE>                         for testing purposes only --->

            </FIELDS>

        </TRANSACTION>

    </REQUEST></cfoutput>

</cfxml>

<cfhttp url="http://127.0.0.1:8500/workspace/cfhttpTest/MyApp.cfc?method=echoXml" method="post">

<cfhttpparam type="xml" value="#xmlRequest#">

</cfhttp>

<cfdump var="#cfhttp.FileContent#">

MyApp.cfc

component {

remote string  function echoXml()

  {

     // the request data

    var xmlDoc = getHttpRequestData().content;

    return toString(xmlDoc);

  }

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 13, 2014 May 13, 2014

Copy link to clipboard

Copied

I solved the issue. The issue had something to do with a setting that returned via tcp/ip and not http.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 13, 2014 May 13, 2014

Copy link to clipboard

Copied

Issue solved.

It was a  matter of changing this line

<REQUEST KEY="#companykey#" PROTOCOL="0" FMT="1" ENCODING="0">

to use PROTOCOL="1"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 14, 2014 May 14, 2014

Copy link to clipboard

Copied

LATEST

Glad to hear you solved it. Please mark the correct answer, as it will help someone else.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation