1 Reply Latest reply on Nov 26, 2008 4:48 AM by Newsgroup_User

    CFHTTP connection failure issue

    Hitesh_Patel-LWMdQu
      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.

      Hitesh.
        • 1. Re: CFHTTP connection failure issue
          Level 7
          Hitesh Patel wrote:
          > 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.

          So in other words this is not strictly a CF problem. My guess is that
          the DNS system doesn't return the correct entries for the client host.

          1. Check that you can connect with telnet to port 80 of the client IP.
          2. Check that you can connect with teletn to port 80 of the client hostname.

          --
          Mack