CFHTTP connection failure error

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

CFHTTP connection failure error

Hitesh Patel-3
I am writing to describe CFHTTP issue.
There is a WINDOWS 2003, IIS 6.0 and ColdFusion 8 is on the server.

Right now if I have to make any CFHTTP call from the server to my client URL (assume client URL is hosted to anywhere in the world) I must need to add that remote URL entry in server HOSTS file...it's really a panic because I have to do this for my every NEW client URL.

CASE 1 (Client URL is NOT mapped in the server's HOSTS file)
1) I can't access client REMOTE URL from the server using IE browser but can access any other site for example http://www.google.com in the IE browser.

2) I can ping client remote URL and that was OK.

3) When I try to connection to client remote URL using CFHTTP I get an error like "Connection Failure : Status code unavailable".

CASE 2 (Client URL is mapped in the server's HOSTS file)
EVERYTHING IS OK.

Now, I have added following code within CFHTTP but no luck!
<cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
<cfhttpparam type="Header" name="TE" value="deflate;q=0">

My CF code template is as below:
===============================
<cfset previewUrl = {my client URL}>
<cfset url.id = XXXXXXX>
<cftry>
   
    <cfhttp method="Get" url="#previewUrl#?id=#url.id#&from=direct" throwonerror="yes" resolveurl="yes">
        <cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
        <cfhttpparam type="Header" name="TE" value="deflate;q=0">
    </cfhttp>
   
    <cfset content = cfhttp.FileContent>
    <cfoutput>#content#</cfoutput>
        <cfcatch>
                <cfoutput>#cfcatch.Message#<br />#cfcatch.Detail#</cfoutput>
        </cfcatch>
</cftry>

====== CF template ends

Can anybody advise me as I DO NOT WANT TO DO MAPPING in HOSTS file at all?
I mean CFHTTP should function properly without HOSTS files mapping.

Thanks a lot in advance.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316000
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4
Reply | Threaded
Open this post in threaded view
|

RE: CFHTTP connection failure error

Jeff Langevin
Never seen that one before.  But here's a shot in the dark.  Any chance you're trying to connect to a secure url (https)?  There is a known issue where cfhttp does not support certain implementations and therefore the certificate gets rejected.  You could try using CFHTTP5 at the tag store.  They have a free eval version so you can at least test to see if it fixes the problem.

http://www.cftagstore.com/tags/cfxhttp5.cfm

--Jeff

________________________________________
From: Hitesh Patel [[hidden email]]
Sent: Wednesday, November 26, 2008 5:06 PM
To: cf-talk
Subject: CFHTTP connection failure error

I am writing to describe CFHTTP issue.
There is a WINDOWS 2003, IIS 6.0 and ColdFusion 8 is on the server.

Right now if I have to make any CFHTTP call from the server to my client URL (assume client URL is hosted to anywhere in the world) I must need to add that remote URL entry in server HOSTS file...it's really a panic because I have to do this for my every NEW client URL.

CASE 1 (Client URL is NOT mapped in the server's HOSTS file)
1) I can't access client REMOTE URL from the server using IE browser but can access any other site for example http://www.google.com in the IE browser.

2) I can ping client remote URL and that was OK.

3) When I try to connection to client remote URL using CFHTTP I get an error like "Connection Failure : Status code unavailable".

CASE 2 (Client URL is mapped in the server's HOSTS file)
EVERYTHING IS OK.

Now, I have added following code within CFHTTP but no luck!
<cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
<cfhttpparam type="Header" name="TE" value="deflate;q=0">

My CF code template is as below:
===============================
<cfset previewUrl = {my client URL}>
<cfset url.id = XXXXXXX>
<cftry>

    <cfhttp method="Get" url="#previewUrl#?id=#url.id#&from=direct" throwonerror="yes" resolveurl="yes">
        <cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
        <cfhttpparam type="Header" name="TE" value="deflate;q=0">
    </cfhttp>

    <cfset content = cfhttp.FileContent>
    <cfoutput>#content#</cfoutput>
        <cfcatch>
                <cfoutput>#cfcatch.Message#<br />#cfcatch.Detail#</cfoutput>
        </cfcatch>
</cftry>

====== CF template ends

Can anybody advise me as I DO NOT WANT TO DO MAPPING in HOSTS file at all?
I mean CFHTTP should function properly without HOSTS files mapping.

Thanks a lot in advance.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316001
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4
Reply | Threaded
Open this post in threaded view
|

Re: CFHTTP connection failure error

Jonathan Larson
In reply to this post by Hitesh Patel-3
I've had this issue before.  The way I solved it was to not use CFHTTP.  Since you are using a winbox, this method should work fine.

<cfobject action="Create" name="objSrvHTTP" class="MSXML2.ServerXMLHTTP">
<cfset myURL = "http://google.com">
<cfset temp = objSrvHTTP.open("GET","#myURL#")>
<cfset temp = objSrvHTTP.send("")>
<cfset myResult = objSrvHTTP.responsetext>

You can find documentation on the methods that MSXML2.ServerXMLHTTP provides at:
http://msdn.microsoft.com/en-us/library/ms762278(VS.85).aspx

Let me know how it turns out! Cheers!

> I am writing to describe CFHTTP issue.
> There is a WINDOWS 2003, IIS 6.0 and ColdFusion 8 is on the server.
>
> Right now if I have to make any CFHTTP call from the server to my
> client URL (assume client URL is hosted to anywhere in the world) I
> must need to add that remote URL entry in server HOSTS file...it's
> really a panic because I have to do this for my every NEW client URL.
>
> CASE 1 (Client URL is NOT mapped in the server's HOSTS file)
> 1) I can't access client REMOTE URL from the server using IE browser
> but can access any other site for example http://www.google.com in the
> IE browser.
>
> 2) I can ping client remote URL and that was OK.
>
> 3) When I try to connection to client remote URL using CFHTTP I get an
> error like "Connection Failure : Status code unavailable".
>
> CASE 2 (Client URL is mapped in the server's HOSTS file)
> EVERYTHING IS OK.
>
> Now, I have added following code within CFHTTP but no luck!
> <cfhttpparam type="Header" name="Accept-Encoding"
> value="deflate;q=0">
> <cfhttpparam type="Header" name="TE" value="deflate;q=0">
>
> My CF code template is as below:
> ===============================
> <cfset previewUrl = {my client URL}>
> <cfset url.id = XXXXXXX>
> <cftry>
   
>
   
> <cfhttp method="Get" url="#previewUrl#?id=#url.id#&from=direct"
> throwonerror="yes" resolveurl="yes">
       
> <cfhttpparam type="Header" name="Accept-Encoding"
> value="deflate;q=0">
       
> <cfhttpparam type="Header" name="TE" value="deflate;q=0">
   
> </cfhttp>
   
>
   
> <cfset content = cfhttp.FileContent>
   

> <cfoutput>#content#</cfoutput>
> <cfcatch>
> <cfoutput>#cfcatch.Message#<br />#cfcatch.Detail#</cfoutput>
> </cfcatch>
> </cftry>
>
> ====== CF template ends
>
> Can anybody advise me as I DO NOT WANT TO DO MAPPING in HOSTS file at
> all?
> I mean CFHTTP should function properly without HOSTS files mapping.
>
> Thanks a lot in advance.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316043
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4
Reply | Threaded
Open this post in threaded view
|

Re: CFHTTP connection failure error

torotoro
In reply to this post by Hitesh Patel-3


I have been having trouble with CFHTTP Too...

Using the following code has fixed my problem as well:
<cfobject action="Create" name="objSrvHTTP" class="MSXML2.ServerXMLHTTP">
<cfset myURL = "http://google.com">
<cfset temp = objSrvHTTP.open("GET","#myURL#")>
<cfset temp = objSrvHTTP.send("")>
<cfset myResult = objSrvHTTP.responsetext> 

Thanks! :D