Copy link to clipboard
Copied
We have a Google Search Appliance (GSA). It cannot be accessed directly through a simple form submission since it is behind our firewall. I have to make a call to it from our website (I am tracking down some docs from Google on this). I can access it when I am VPN'd into our network. SO I thought I would attempt to write a cfc utilizing cfhttp to make the call. I began by writing a simple cfc on a cfm page but I get the following error...
I have searched all over the web and tried various fixes to no avail. Here is my cfhttp code...
<cfhttp method="get" url="http://googleapp01.corporate-domain.net/search?" timeout="60" throwonerror="yes" charset="utf-8">
<cfhttpparam type="url" name="proxyreload" value="1">
<cfhttpparam type="url" name="proxystylesheet" value="activant_com">
<cfhttpparam type="url" name="getfields" value="*">
<cfhttpparam type="url" name="q" value="pos" encoded="yes">
<cfhttpparam type="url" name="btnG" value="Search" encoded="yes">
<cfhttpparam type="url" name="access" value="p">
<cfhttpparam type="url" name="output" value="xml_no_dtd">
<cfhttpparam type="url" name="client" value="activant_com">
<cfhttpparam type="url" name="site" value="activant_com">
<cfhttpparam type="url" name="filter" value="p">
</cfhttp>
<cfdump var="#cfhttp#">
So as you can see, nothing especially difficult here, but I cannot figure out why it will not resolve, especially since I can access it through a browser.
Thoughts?
~Clay
Copy link to clipboard
Copied
Any chance that you are supposed to be connecting to it through SSL with an HTTPS protocol?
How do you exactly connect to the appliance with a browser?
Copy link to clipboard
Copied
In my browser, I simply use the url that is parse out into the cfhttp code above. I do not use ssl.
Copy link to clipboard
Copied
Couple thoughts.
1) DNS gets cached. So if the server wouldn't normally know the domain in
the URL and you tested and figured that out, then changed the hosts file on
the server, CF still has the old info cached. A restart of the service will
clear that.
2) Where is the browser you are testing with? Physically browsing from the
webserver? If you are on the webserver itself (or remoted into it of
course), and pull up that URL what do you see?
Copy link to clipboard
Copied
I am simply browsing from my laptop. I can access it just fine via the browser and plain ol' url, but cannot pull it back with cfhttp.
Copy link to clipboard
Copied
The point being is your website server also connected to your vpn? If not
do you have some sort of proxy situation you can leverage so it can connect
through?
Copy link to clipboard
Copied
From what the IT guys tell me, there is not proxy on our web server. It should be able to access it. I do not have access to the server itself. Incidentally, I tried a simple iFrame to see if it would pull the url and it does just fine. So I am thinking that it is something with the way cfhttp is functioning.
Copy link to clipboard
Copied
If you are sure the server should have no trouble connection then it is
probably DNS. The error you are getting is indicative of that. Ask your
team to open a web browser and view that URL. see what the web browser
shows.
My guess is that your web server has no DNS understanding of that domain you
are sending it too. Or that there is an old hosts record pointing it to the
wrong IP.
Copy link to clipboard
Copied
First, from the server console, open a command prompt and try resolving the appliance's name. You can easily do that with ping. If that doesn't work, it's a DNS problem. You can resolve this DNS problem by editing the server's hosts file, getting the appropriate entry added to the DNS server used by your server, or by using the IP address of the appliance instead of the name.
Second, just try to fetch the base URL directly, rather than sending all the URL parameters.
Third, use a tool like Wireshark on the server to examine the traffic between CF and your appliance.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/
Copy link to clipboard
Copied
If you google "cfhttp connection failure" there's a few different things that people have encountered that yield this error.
Have you investigated them?
--
Adam
Copy link to clipboard
Copied
Yes. That is exactly what I googled and nothing I discovered worked.
Copy link to clipboard
Copied
Yes. That is exactly what I googled and nothing I discovered worked.
OK, so to minimise the guess work the rest of us need to do... what have you tried?
The first few posts I read suggested:
* a redirect not being followed;
* HTTP compression being enabled.
(along with various DNS-resolution issues other respondents here seem to already be covering).
--
Adam
Copy link to clipboard
Copied
It's worth noting as well that CF maintains its own DNS cache outside the server's own. Only restarting CF will clear it out...
Copy link to clipboard
Copied
I tried the compression fix, the redirect fix, the header encoding fix. I also tried resolving with no parameters. Basically everything from the first two pages of the Google search results.
Copy link to clipboard
Copied
But did you confirm the server can see the other server by that domain name?
Talk to your web server admin. Dave mentioned using Ping, which is a good
idea and easy to do.
You browsing from your notebook, or using an iframe doesn't prove anything.
The error is saying CF can't http to that URL. For one reason or another.
Probably DNS or firewall related.
Copy link to clipboard
Copied
I contacted our IT department. Have not heard back yet.
Copy link to clipboard
Copied
Just a thought... try setting the CFHTTP user agent sting to be something "normal" (eg: spoof that you're using Firefox). I can't recall whether it was with Google or not, but I have certainly had issues with CFHTTPing some services if I use the default user agent that CF uses. It should not matter, but sometimes it does, it seems.
--
Adam
Copy link to clipboard
Copied
ok...I figured it out. In working with my IT staff, they thought that everything was fine from the network standpoint, but it was not. So my code was fine, but the network needed addressed. So if anyone else runs into this make double sure that there are no network issues.
Copy link to clipboard
Copied
fs22, did they mention what the network issue was by any chance?
Copy link to clipboard
Copied
They did not mention what it was, but my guess qould be that there was a port (80?) that was not allowing traffic through.
Copy link to clipboard
Copied
The Google Search Appliance doesn't do any user-agent filtering.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/
Copy link to clipboard
Copied
The Google Search Appliance doesn't use redirects for this, and compression isn't used - neither of those are problems when fetching GSA results using CF.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/
Copy link to clipboard
Copied
Thanks for the info, Dave. I had tried that and as you point out...it did not do anything.
Copy link to clipboard
Copied
Also experiencing the same error and have not solved it yet. Restarting CF is not the solution.