Connection Failure with Yahoo Web Services and ColdFusion

coldfusion

If you tried using the Yahoo Web Services with CFHTTP and your cfhttp.filecontent variable had the value: Connection Failure, or if you had throwonerror="true" and you got the error: Connection Failure: Status code unavailable it is due to an encoding issue. You need to set charset="utf-8" in your CFHTTP call.

Yahoo point's out in their FAQ item: Why does ColdFusion keep giving me a "Connection Failure" message?

It's an encoding issue. You need to add <cfhttpparam type="Header" name="charset" value="utf-8" /> to your cfhttp call and it should work.

This didn't work for me when I tried it, only setting the charset attribute in CFHTTP did the trick for me. What I suspect is that in ColdFusion MX 7 setting the header with CFHTTPPARAM works, but does not in 6.1



11 people found this page useful, what do you think?

 Download FuseGuard WAF for ColdFusion

Trackbacks

Trackback Address: 305/9710CA575891B52A759349EF27FEEB63

Comments

On 04/07/2005 at 11:30:57 AM EDT foO wrote:
1
it took me forever to figure that one out, let me tell you!

awesome site and a great CF resource, and it's quickly become a daily for me :)

On 01/18/2006 at 1:35:07 PM EST Andrew wrote:
2
Thank you! I've been struggling with it all day!

On 05/09/2006 at 9:14:39 AM EDT Kevin wrote:
3
That's awesome... i also tried the cfhttpparam using CFMX7 and it didn't work... i changed it to your solution and it worked. Thank you.

On 09/12/2006 at 1:41:28 PM EDT rafael wrote:
4
what is cold fusion using for web service, what's underneat-axis?

On 09/12/2006 at 2:56:43 PM EDT Pete Freitag wrote:
5
Yes CF uses apache axis for web services, but I am just using http here.

On 09/27/2006 at 6:55:45 PM EDT Tony wrote:
6
Hey, I just wanted to add that this happens for Google Maps as well. I posted a short blurb on my blog (http://brandner.blogspot.com/2006/09/connection-failure-for-cfhttp-and.html) with the details.

Thanks for this post, it helped save the day!

Tony

On 10/13/2006 at 12:51:59 AM EDT jerry wrote:
7
great solutions can be found at http://www.corporatesitesolutions.com

On 01/02/2007 at 3:15:23 PM EST raman wrote:
8
Hi, can someone help me in resolving Connection Failure: Status code unavailable exception when I <cfhttp> tag is called, the parameters for cfhttp tag are: <cfhttp throwonerror="Yes" timeout="5200" resolveurl="Yes" redirect="No" METHOD="POST" URL="https://test123-dev.test.com/MyApp/index.cfm" PATH="/my/data/is_here" FILE="test1.html"> <CFHTTPPARAM type="formfield" name="fuseaction" value="reports:PrintRpts"> </cfhttp>

can someone pls explain why this code throws an exception as stated above. The other thing I have in url is https, is there special settings need to be done on server so that this exception can be stopped. Thanks in advance for your help.

On 05/07/2007 at 5:34:53 PM EDT walter wrote:
9
why my yahoo messenger has bad connection it wont connected me to my yahoo messenger and is pissinssing me the help me know ok

On 06/29/2010 at 1:13:46 AM EDT sterling wrote:
10
I could kiss you. I've been working on this for over a week and on a whim I tried you solution and Bam. It worked. Thanks so much!!!

On 11/18/2010 at 2:01:58 AM EST AKS88 wrote:
11
Hi every one. I tried this method but to no avail. I still get the "Connection Failure" error. Here is my code

<cfhttp url="http://mail.yahoo.com/" method="get" redirect="Yes" resolveurl="Yes"> <cfhttpparam type="Header" name="charset" value="utf-8" /> </cfhttp> <cfoutput> <cffile action="WRITE" file="c:\inetpub\wwwroot\new.html" output="#cfhttp.FileContent#" addnewline="Yes" nameconflict="OVERWRITE"> <cflocation url="new.html" addtoken="No"> </cfoutput>

On 02/16/2012 at 7:44:28 AM EST Muskan wrote:
12
I am getting "Connection Failure: Status code unavailable" while executing the below code: <cftry> <!---<cfhttp url="http://su.symexbelgium.com/flux_xml.html" charset="UTF-8" redirect="no" throwOnError="yes"/>---> <cfhttp url="http://dummy.com/flux_xml.html" charset="UTF-8" redirect="no" throwOnError="yes"> <cfhttpparam type="header" name="accept-encoding" value="no-compression"/> </cfhttp> <cfcatch type="any"> <cfdump var="#cfcatch.message#"> </cfcatch> </cftry>

Any help will be appericated.

Post a Comment




  



Spell Checker by Foundeo

Recent Entries



foundeo


did you hack my cf?