Solved

How to avoid Connection Failure with cfhttp...

Posted on 2009-07-04
2
1,112 Views
Last Modified: 2013-12-20
Expert Needed:

I have a post and it gets a connection failure -popped up outa nowhere. It was working fine.

I created a page that basically submits a form automated sumbit with all hidden fields and it works fine, same form fields. Any Suggestions from the experts? I need the cfhttp to work.
<!--- This gets a coonection failure: --->

<cfhttp url="https://URL.aspx" method="post"> 

<cfhttpparam type="FORMFIELD" name="Name" value="Nick Sabane">

<cfhttpparam type="FORMFIELD" name="Address" value="101 Main st">

<cfhttpparam type="FORMFIELD" name="City" value="Mobile">

<cfhttpparam type="FORMFIELD" name="State" value="AL">

<cfhttpparam type="FORMFIELD" name="Zip" value="35444">

<cfhttpparam type="FORMFIELD" name="Phone" value="2563417449">

<cfhttpparam type="FORMFIELD" name="Email" value="123@aol.biz">

<cfhttpparam type="FORMFIELD" name="Company" value="My Company">

</cfhttp>
 
 

<cfoutput>#cfhttp.FileContent#</cfoutput>
 

This works:

<cfform action="https://URL.aspx" method="post" name="form1" target="_self">

<input name="Name" type="hidden" value="Nick Sabane" />

<input name="Address" type="hidden" value="115 Main st" />

<input name="City" type="hidden" value="Mobile" />

<input name="State" type="hidden" value="AL" />

<input name="Zip" type="hidden" value="35444" />

<input name="Phone" type="hidden" value="2563417449" />

<input name="Email" type="hidden" value="123@aol.biz" />
 

<input name="Company" type="hidden" value="My Company" />

<script>

document.form1.submit();

</script>

</cfform>

Open in new window

0
Comment
Question by:LeadCo
2 Comments
 
LVL 27

Accepted Solution

by:
azadisaryev earned 500 total points
ID: 24779017
form post using cfhttp to a secure page can be tricky, especially if the page/web service requires client certificates...

here's from CFML Reference Manual:

"To use HTTPS with the cfhttp tag, you might need to manually import the certificate for each web server into the keystore for the JRE that ColdFusion uses. This procedure should not be necessary if the certificate is signed (issued) by an authority that the JSSE (Java Secure Sockets Extension) recognizes (for example, Verisign); that is, if the signing authority is in the cacerts already. However, you might need to use the procedure if you are issuing SSL (secure sockets layer) certificates yourself.
Manually import a certificate
1     Go to a page on the SSL server in question.
2     Double-click the lock icon.
3     Click the Details tab.
4     Click Copy To File.
5     Select the base64 option and save the file.
6     Copy the CER file into C:\CFusionMX7\runtime\jre\lib\security (or whichever JRE ColdFusion is using).
7     Run the following command in the same directory (keytool.exe is located in C:\CFusionMX7\runtime\jre\bin): keytool -import -keystore cacerts -alias giveUniqueName -file filename.cer"

you should check with the service provider if you have to include any SSL client certs, or any other data in the manual post (i.e. it may require a cookie, or a valid user agent, or something else) - cfhttp does not send any of that data by itself.

Azadi
0
 

Author Closing Comment

by:LeadCo
ID: 31599877
Thanks good to know!!!!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now