Solved

How to avoid Connection Failure with cfhttp...

Posted on 2009-07-04
2
1,125 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…

756 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