CFHTTP
Okay I will describe our problem.
We are running CF 6.1 and IIS 6 on server 2003.
We have a service that people post to and get a response. In
the script we have a CFHTTP call to a remote URL. If the CFHTTP
takes longer than 18 seconds which can happen IIS seems to lose
site of the CFHTTP. The web browser does nothing. It literally just
sits there.
So what we have been doing is setting the timeout value on
the CFHTTP to 17 seconds to prevent this hang.
We thought maybe it was a CF problem so to rule it out we
wrote an ISAPI filter that has nothing to do with cold fusion where
you can pass in the time to sleep.
Here is the URL to the script that calls the dll. Pass in
time is in miliseconds so 18 seconds will be 18000. Try it for
18000 then 19000 and you will see the effect.
http://mercury.velocitygroup.co.uk/sleepTestPost2.htm
So as it is calling a dll cold fusion does not appear to be
the problem
We cannot work out where this arbitrary 18 seconds is coming
from. We need our CFHTTP to last for 31 seconds. Does anyone know
where this 18 seconds is coming from and how to change it.
Beware of ISAPI extensions. Assuming you intend to use the
IIS server exclusively for ColdFusion, it is the recommended
practice to disable all other Web Service Extensions in the IIS
Manager, with the exception of Macromedia Server Extensions.
I agree with Mr Black's point about script timeouts relating
only to ASP files. However, ISAPI-induced timeout effects are
usually not that straightforward. As far as IIS is concerned,
ColdFusion's functionality is on a par with that of the next ISAPI
application. IIS forwards CFM, CFC, CFR, etc. requests to the
appropriate Coldfusion DLL for processing. The server DLL sends the
result back to IIS, which in turn sends it to the client as the
response to the client's request. Any ISAPI filter that can disrupt
the global timeout settings of the IIS server can therefore affect
the performance of CFM pages, albeit indirectly.
Similar Messages
-
Hi,
I am reading an xml file that contains emails with attachments (one email per item/node, but may contain multiple attachments). I am trying to save the attachments to our server. So I'm looping over the multiple attachments of a single email and using cfhttp to GET the attachments from another server and save them with the same filename on our server.
The problem is that it works for the first attachment - it's saved to the server, status code is 200 OK - awesome! But for any attachments after that, it does not save them and throws a Conection Failure error. No matter what attachments they are.
In trouble shooting I tried several things. First, inside of my loop of attachments, I can hardcode the cfhttp calls with the url and filename of the attachments - one right after the other - and all is perfect everytime!! But it obviously needs to be dynamic. I also tried to save a list of the attachment urls from the loop, and then call a separate cfhttp tag for each attachment in the list (so again, was in a loop) and it works for the first attachment in the list and not for the others (same errors as above).
Here's a simplified version of the code. I can't put in the real xml url, and when I set the "attachmentFilename" I left out that code because it works and is too much code. Also, the XML works fine. Please let me know if you have any suggestions, and of course, if you need more info from me!!
Thanks so much,
Kirsten
<cfoutput>
<cfhttp url="https://www.myxml.com/example.xml" method="get" resolveurl="no" />
<cfset myXML = trim(cfhttp.FileContent)>
<cfset myXML = xmlParse(myXML)>
<cfset theRoot = myXML.XmlRoot>
<cfset numChildren = arrayLen(theRoot.XMLChildren[1].XmlChildren)>
<cfloop index="i" from="6" to="#numChildren#">
<cfset attachments = theRoot.XMLChildren[1].XMLChildren[i]["attachments"].XmlText>
<cfif ListLen(attachments, "|^|") gt 2>
<cfset loop_unid = theRoot.XMLChildren[1].XMLChildren[i]["unid"].XmlText>
<cfset counter = 0>
<cfset attachmentArray = ListToArray(attachments, "|^|")>
<cfloop from="1" to="#ArrayLen(attachmentArray)#" index="k">
<cfset counter = counter + 1>
<cfset attachmentURL = attachmentArray[k]>
<cfset attachmentFilename = Replace(attachmentArray[k],"strip the url from the filename in the url","")>
<cfhttp url="#attachmentURL#" method="get" resolveurl="no" timeout="120" path="D:\my_servers_path\attachmentFolder\" file="#attachmentFilename#">
attachment counter: #counter#<BR />
cfhttp.statusCode: #cfhttp.statusCode#<BR />
cfhttp.errorDetail: #cfhttp.errorDetail#<BR />
</cfloop>
</cfif>
</cfloop>
</cfoutput>
Output Results:
attachment counter: 1
cfhttp.statusCode: 200 OK
cfhttp.errorDetail:
attachment counter: 2
cfhttp.statusCode: Connection Failure. Status code unavailable.
cfhttp.errorDetail: I/O Exception: peer not authenticated
attachment counter: 3
cfhttp.statusCode: Connection Failure. Status code unavailable.
cfhttp.errorDetail: I/O Exception: peer not authenticatedWe've seen the peer not authenticated error quite a bit on our CFHTTP calls - are you trying to access the URLs via HTTPS? It seems the SSL certificate keystore that CF ships with does not contain all the vendor SSL certificates out there - when CF can't authenticate a cert, it throws that "Connection Failure / Peer not authenticated Error". In order to fix the issue, you have to import the SSL certificate of the site you are trying to access into the CF cert store on your server(s). If you are using multiple servers, you will have to import the cert on each server.
I'm sure a google search will turn up a step by step guide on how to do this, but the basic steps are:
Go to a page on the SSL server.
Double-click the lock icon.
Click the Details tab.
Click Copy To File.
Select the base64 option and save the file.
Copy the CER file into ColdfusionDir\runtime\jre\lib\security
Run the following command from the same directory (keytool.exe is located in ColdfusionDir\runtime\jre\bin) ..\..\bin\keytool.exe -import -keystore cacerts -alias UniqueName -file filename.cer
Restart Coldfusion
Hope that helps!
- Michael -
Creating a cfhttp multi part form post for google docs upload
Hey all,
If you saw my last thread, you know I am working with google docs and uploading documents to it. Well I got basic document uploading working, but now I am trying to include meta data. Google requires you to include the metadata with the actual file data and seperate them by using a multi part form upload. I don't know exactly the process for doing so, but they have a handy code snippet of the desired results at
http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#UploadingDoc s
So I am basically trying to mimic that payload, however I am continually getting an error stating that there are no parts in a multi part form upload.
<errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>InvalidEntryException</code><internalReason>No parts detected in multipart message</internalReason></error></errors>
to be exact. I am not really sure what I am doing wrong here. I figure it is one of two things, either I am not including the actual data in the payload properly (I am currently using a body type param for the payload, but I have also tried a formfield named content to deliver it. Neither worked). So maybe I need to do something else tricky there? The other thing which I am not reallly sure about is the content-length attribute. I don't know exactly how to calculate that, and I read in another forum that a content length attribute was messing that guy up. Right now I am just taking the lenght of the payload string and multiplying by 8 (to get the number of bytes for the entire payload) but hell if I know if that is right. It could be I just don't know how to set up the parts for the message, it seems pretty straight forward though. Just define a boundary in the content-type, then put two dashes before it wherever you define a new part, and two dashes trailing the last part.
Anyway, here is my code, any help is much appreciate. I'm a bit beyond my expertise here (not really used to trying to have to roll my own http requests, nevermind multipart post form data) so I'm kinda flailing around. Thanks again.
<cffunction name="upload" access="public" returnType="any" hint="I upload the document." output="false">
<cfargument name="filePath" type="string" required="false" hint="file to upload.">
<cfargument name="docType" type="string" required="yes" hint="The document type to identify this document see google list api supported documents">
<cfargument name="parentCollectionId" type="string" required="no" hint="the name of the collection/collection to create (include collection%3A)">
<cfargument name="metaData" type="struct" required="no" hint="structure containing meta data. Keyname is attribute name, value is the value">
<cfset var result = structnew()>
<cfset result.success = true>
<cftry>
<cfif structkeyexists(arguments,"parentCollectionId")>
<cfset arguments.parentCollectionId = urlencodedformat(parentCollectionId)>
<cfset result.theUrl = "https://docs.google.com/feeds/default/private/full/#arguments.parentCollectionId#/contents">
<cfelse>
<cfset result.theUrl = "https://docs.google.com/feeds/default/private/full/">
</cfif>
<cfoutput>
<cffile action="read" file="#arguments.filePath#" variable="theFile">
<cfsavecontent variable="atomXML">
Content-Type: application/atom+xml
<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007">
<category scheme="http://schemas.google.com/g/2005##kind"
term="http://schemas.google.com/docs/2007###arguments.docType#"/>
<cfloop collection="#arguments.metaData#" item="key">
<#key#>#arguments.metadata[key]#</#key#>
</cfloop>
</entry>
--END_OF_PART
Content-Type: text/plain
#theFile#
--END_OF_PART--
</cfsavecontent>
</cfoutput>
<cfset result.postData = atomXML>
<cfhttp url="#result.theUrl#" method="post" result="httpRequest" charset="utf-8" multipart="yes">
<cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#getAuth()#">
<cfhttpparam type="header" name="GData-Version" value="3">
<cfhttpparam type="header" name="Content-Length" value="#len(trim(atomXML))*8#">
<cfhttpparam type="header" name="Content-Type" value="multipart/related; boundary=END_OF_PART">
<cfhttpparam type="header" name="Slug" value="test file --END_OF_PART">
<cfhttpparam type="body" name="content" value="#trim(atomXML)#">
</cfhttp>
<cftry>
<cfset packet = xmlParse(httpRequest.fileContent)>
<cfif httpRequest.statusCode neq "201 created">
<cfthrow message="HTTP Error" detail="#httpRequest.fileContent#" type="HTTP CODE #httpRequest.statusCode#">
</cfif>
<cfset result.data.resourceId = packet.entry['gd:resourceId'].xmlText>
<cfset result.data.feedLink = packet.entry['gd:feedLink'].xmlText>
<cfset result.data.title = packet.entry.title.xmlText>
<cfset result.data.link = packet.entry.title.xmlText>
<cfcatch>
<cfset result.data = httpRequest>
</cfcatch>
</cftry>
<cfcatch type="any">
<cfset result.error = cfcatch>
<cfset result.success = false>
</cfcatch>
</cftry>
<cfreturn result>
</cffunction>
Also, this is what my atomXML data ended up looking like when it got sent to google. This isn't the WHOLE request (it doesn't include the headers, just the body).
Content-Type: application/atom+xml
<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007">
<category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#document"/>
<TITLE>Woot Test</TITLE> </entry>
--END_OF_PART
Content-Type: text/plain
I'm a test document lol!
--END_OF_PART--Woot, I got it. I had to send the gData version number, and change the URL.
Here is the working function.
<cffunction name="upload" access="public" returnType="any" hint="I upload the document." output="false">
<cfargument name="myFile" type="string" required="false" hint="file to upload.">
<cfset var result = "">
<cfset theUrl = "https://docs.google.com/feeds/default/private/full">
<cffile action="read" file="C:\website\xerointeractive\testing\test.txt" variable="theFile">
<cfset fileSize = createObject("java","java.io.File").init("C:\website\xerointeractive\testing\test.txt").length()>
<cfhttp url="#theURL#" method="post" result="result" charset="utf-8" >
<cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#getAuth()#">
<cfhttpparam type="header" name="Content-Type" value="text/plain">
<cfhttpparam type="header" name="Slug" value="test file">
<cfhttpparam type="header" name="GData-Version" value="3">
<cfhttpparam type="header" name="Content-Length" value="#fileSize#">
<cfhttpparam type="body" value="#theFile#">
</cfhttp>
<cfreturn result>
</cffunction> -
Cfhttp compression error.
We switched to a new web server and I am getting the IIS
compression error
with cfhttp.
I found the solution on the Docs and also on other sites, but
it isn't
working for me.
Can someone check my code and see if I missed something:
<cfhttp url="
http://mywebsite.com/campaign/csv/#campaign.csv#"
name="uploadlist" method="get" textqualifier=""
throwonerror="yes">
<cfhttpparam type="Header" name="Accept-Encoding"
value="deflate;q=0">
<cfhttpparam type="Header" name="TE"
value="deflate;q=0">
</cfhttp>
I found the answer here, but maybe I missed something?
http://www.talkingtree.com/blog/index.cfm?mode=entry&entry=25AA8297-45A6-2844-729DBD51575C 1BD2FYI.
I get this error:
Connection Failure: Status code unavailable
on this line:
<cfhttpparam type="Header" name="TE"
value="deflate;q=0"> -
Hello,
I'm trying to run a process with CFHTTP, and waiting until it's finished, then run another CFHTTP page. Will the second request wait for the first request to complete before running?
If not, how can I do this?
Thanks,
PeterOK, faced with your dilemma, this is what I would do:
* start from a position that as a general rule, CF code runs sequentially, completing each instruction in series, one at a time: the previous instruction completing before the next starts. There's no reason to think CFHTTP is any different to any other CF instruction.
* RTFM, to see what that has to say. The docs for CFHTTP are here: http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7f fc.html. In reading that lot, it strongly hints at what the answer is.
* not being one to trust the CF docs, I would spend 5min knocking some code together to test this.
Indeed those three steps are exactly what I did when prepping for my response to you.
I think you should try to work this out for yourself, rather than asking someone else, but here's the code I used to test:
<!--- test.cfm --->
<cflog file="cfhttpSerialisation" text="Before first call">
<cfhttp method="get" url="http://#CGI.http_host#/path/to/target.cfm">
<cflog file="cfhttpSerialisation" text="After first call">
<cfset sleep(5000)>
<cflog file="cfhttpSerialisation" text="Before second call">
<cfhttp method="get" url="http://#CGI.http_host#/path/to/target.cfm">
<cflog file="cfhttpSerialisation" text="After second call">
<!--- target.cfm --->
<cflog file="cfhttpSerialisation" text="Top of target.cfm">
<cfset sleep(5000)>
<cflog file="cfhttpSerialisation" text="Bottom of target.cfm">
Obviously change /path/to/target.cfm to be correct.
What does running that tell you?
Adam -
How to fix a problem with the order of strings in a JSON response for a CFHTTP request?
Good morning, guys! (It's 10:50 a.m. in Brazil)
First of all, I'm still new at CF and my questions may seem too much silly and my English's not the best, so, please be patient with me. hehe
Well, I'm accessing a link via CFHTTP that gives me a JSON response. I'm not familiar with JSON yet, so I'm working it as a string and using string functions (Find,RemoveChars,Replace,etc), but it happens to me that I'm receiving a certain kind of order of the strings list from the JSON when I access it directly from the browser and other kind of order totally different when I access it from the CFHTTP.
I only figured it out because I was working at home with my code and there everything went just fine as expected. Then I brought to my job to develop a little bit more as soon as I get a free time and here my code doesn't work anymore. When I took a look at the JSON by a CFOUTPUT, I realized the strings were in a different order.
Does anyone know why is it happening?
Link to the JSON: http://sigmine.dnpm.gov.br/ArcGIS/rest/services/extra/dados_dnpm/MapServer/0/query?text=83 0620/2012&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelInter sects&where=&returnGeometry=true&outSR=&outFields=FID,Shape,PROCESSO,ID,NUMERO,ANO,AREA_HA ,FASE,ULT_EVENTO,NOME,SUBS,USO,UF&f=pjson
Basic code simplified to find out that the order of strings were coming different when access by CFHTTP:
<cfhttp url="#URLAbove#" method="get" result="DadosDoDNPM" charset="utf-8" timeout="10000" />
<cfset DadosJSON = deserializeJSON(DadosDoDNPM.FileContent) />
<cfif arrayLen(DadosJSON.features)>
<cfset CodigoFonteJSON = ToString(serialize(DadosJSON.features)) />
<cfoutput> #CodigoFonteJSON# </cfoutput>
</cfif>
Is there a way to fix it and to make my code work everywhere?
If it matters, I use Railo at home and at my job.
Since now, I thank you.When you deserialize JSON data, ColdFusion converts it into native structures and arrays (roughly equivalent to JavaScript objects and arrays). In ColdFusion, structures are unordered (that is, they don't maintain keys in any particular ordered sequence).
This really shouldn't be a problem though, at least not if you just want to work with the data contained in the deserialized JSON structure. So DadosJSON should be a native ColdFusion structure, and you can interact with it like any other structure in ColdFusion. In fact, you should not have to re-serialize it at all unless you need to send it to an external application using JSON.
Why are you reserializing the data? And why use serialize() instead of serializeJSON()?
-Carl V. -
Cfhttp: Migration of Webservice from CF 6.1 to CF 8.0.1 fails
Hello,
our application is consumer of a webservice. It works well on CF 6.1 (Sun Solaris) for longer time.
Now we have to migrate to a new platform with CF 8.0.1 on Linux. The service returns "Connection Failure".
Because of security reasons username and password must be in the SOAP header. So we implemented the service invocation via CFHTTP.
Can please anybody help?
We assume that the error has something to do with a wrong or wrong interpreted content length of the returned code.
Thank you very much in advance and greetings from Germany.
Rainer
Facts:
- The physical connection to the webservice server is ok. Requests of us can be found in the logfiles there. It seems they are processed there normally.
- If we send wrong XML data intentionally (invalid XML-syntax, wrong user name...) the returned data contains sensible error messages which comes definitly from the target server.
- If we send correct XML data the only file content which is return is "Connection Failure"
- There are no hints in the logfiles.
- The sended data does not contain any special character.
- The returned data can contain special characters (e.g. German umlauts).
The code:
<cfprocessingdirective pageencoding="iso-8859-1">
<!--- ... --->
<cfsavecontent variable="soap"><?xml version="1.0" encoding="utf-8" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:opal="#request.opal_webservice_ns#">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext" soapenv:mustUnderstand="1">
<wsse:UsernameToken>
<wsse:Username>#request.opal_username#</wsse:Username>
<wsse:Password Type="wsse:PasswordText">#request.opal_password#</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<opal:OPAL_spc-_spcGet_spcAREMIS_spcOpportunity_spcData_GetAREMISData_Input>
<opal:Process_spcInstance_spcId></opal:Process_spcInstance_spcId>
<opal:Object_spcId>#ucase(opalid)#</opal:Object_spcId>
<opal:Siebel_spcOperation_spcObject_spcId>?</opal:Siebel_spcOperation_spcObject_spcId>
<opal:Error_spcCode></opal:Error_spcCode>
<opal:Error_spcMessage></opal:Error_spcMessage>
</opal:OPAL_spc-_spcGet_spcAREMIS_spcOpportunity_spcData_GetAREMISData_Input>
</soapenv:Body>
</soapenv:Envelope>
</cfsavecontent>
<cfhttp method="post" url="#request.opal_webservice_url#" throwonerror="no" timeout="20" charset="utf-8">
<cfhttpparam type="Header" name="charset" value="UTF-8" />
<cfhttpparam type="header" name="SOAPAction" value="#request.opal_webservice_soapaction#">
<cfhttpparam type="header" name="Host" value="#request.opal_webservice_host#">
<cfhttpparam type="header" name="Content-Length" value="#len(soap)#">
<cfhttpparam type="XML" name="XML" value="#soap#">
</cfhttp>
<cfdump var="#cfhttp#" label="cfhttp">
Technical data of the new server (which fails):
Operating system (uname -a):
Linux mhpa3y4c 2.6.18-028stab060.8 #1 SMP Mon Feb 9 20:25:36 MSK 2009 i686 i686 i386 GNU/Linux
Server Details
Server Product ColdFusion
Version 8,0,1,195765
Edition Enterprise
Serial Number 1185-5039-8342-3354-3033-xxxx
Operating System UNIX
OS Version 2.6.18-028stab060.8
Update Level /opt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/updates/hf801-1878 .jar
JVM Details
Java Version 1.6.0_14
Java Vendor Sun Microsystems Inc.
Java Vendor URL http://java.sun.com/
Java Home /usr/java/jdk1.6.0_14/jre
Java File Encoding ASCII
Java Default Locale en_US
File Separator /
Path Separator :
Line Separator Chr(10)
User Name webrun
User Home /home/webrun
User Dir /opt/jrun4/bin
Java VM Specification Version 1.0
Java VM Specification Vendor Sun Microsystems Inc.
Java VM Specification Name Java Virtual Machine Specification
Java VM Version 14.0-b16
Java VM Vendor Sun Microsystems Inc.
Java VM Name Java HotSpot(TM) Server VM
Java Specification Version 1.6
Java Specification Vendor Sun Microsystems Inc.
Java Specification Name Java Platform API Specification
Java Class Version 50.0
Java Class Path CF Classpath
pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/updates/hf801-1878.ja r: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/updates/chf8010002.ja r: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/mlibwrapper_jai.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jaxb-api.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/commons-net-1.4.0.jar : pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jpedal.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/xml-apis.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/verity.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jai_core.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/asn1.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/xercesImpl.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/certj.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/smpp.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jnbcore.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/vparametric.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/wsdl2java.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/wsdl4j-1.5.1.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/derbytools.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/axis.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/commons-beanutils-1.6 .jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/bcel.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jstack.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/java2wsdl.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jintegra.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/cf-assembler.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/im.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/poi-2.5.1-final-20040 804.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/saaj.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/xsdlib.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/ldap.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/clibwrapper_jiio.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jutf7-0.9.0.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/mysql-connector-java- commercial-5.0.5-bin.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/flex-messaging.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/iTextAsian.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/derbyclient.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/commons-discovery-0.2 .jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/smack.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/mm-mysql-jdbc.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/vsearch.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/cfusion.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/postgresql-8.1-407.jd bc3.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/ib6core.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/tools.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/ib6swing.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/cfusion-req.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/flashgateway.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/commons-digester-1.7. jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/ldapbp.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/mail.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/log4j-1.2.12.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/STComm.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jaxb-libs.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jsch-0.1.28m.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/vadmin.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/cf4was.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/cf-logging.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/crystal.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jai_imageio.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/xalan.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/pdfencryption.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/derbyrun.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/cf-acrobat.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jax-qname.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/derby.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/ri_generic.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/httpclient.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/izmado.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/ant.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/derbynet.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/namespace.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/backport-util-concurr ent.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/iText.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/commons-httpclient-3. 0.1.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/commons-collections-2 .1.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/macromedia_drivers.ja r: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jaxb-xjc.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jakarta-oro-2.0.6.jar : pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/cdo.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/ib6addonpatch.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/commons-logging-api.1 .0.4.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jaxrpc.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/ant-launcher.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/cf4was_ae.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/ib6util.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/webchartsJava2D.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/cdohost.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jai_codec.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/metadata-extractor-2. 2.2.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jakarta-slide-webdavl ib-2.1.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/FCSj.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/relaxngDatatype.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jdom-1.0.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jaxb-impl.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/flex-messaging-opt.ja r: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/poi-contrib-2.5.1-fin al-20040804.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/flex-messaging-common .jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/wc50.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/flex-messaging-req.ja r: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/jeb.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/commons-logging.1.0.4 .jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/rome-cf.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/commons-codec-1.3.jar : pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/ib6http.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/tt-bytecode.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/gateway/lib/examples.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/gateway/lib/: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/flex.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/jcert.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/batik-css.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/batik-util.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/commons-logging.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/batik-transcoder.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/oscache.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/jsse.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/jakarta-oro-2.0.7.jar : pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/commons-discovery.jar : pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/batik-awt-util.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/concurrent.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/jnet.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/batik-ext.jar: pt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfform/jars/: :
Server Classpath
/opt/jrun4/servers/lib:
/opt/jrun4/servers/lib/jrun-patch.jar:
/opt/jrun4/servers/lib/pbclient42RE.jar:
/opt/jrun4/servers/lib/pbserver42RE.jar:
/opt/jrun4/servers/lib/pointbase-service.jar:
/opt/jrun4/servers/lib:
/opt/jrun4/servers/lib/jrun-patch.jar:
/opt/jrun4/servers/lib/pbclient42RE.jar:
/opt/jrun4/servers/lib/pbserver42RE.jar:
/opt/jrun4/servers/lib/pointbase-service.jar:
/opt/jrun4/lib:
/opt/jrun4/lib/instutil.jar:
/opt/jrun4/lib/java2wsdl.jar:
/opt/jrun4/lib/jrun-ant-tasks.jar:
/opt/jrun4/lib/jrun-xdoclet.jar:
/opt/jrun4/lib/jrun.jar:
/opt/jrun4/lib/jrunwizard-installer.jar:
/opt/jrun4/lib/jrunwizard.jar:
/opt/jrun4/lib/jspc.jar:
/opt/jrun4/lib/macromedia_drivers.jar:
/opt/jrun4/lib/migrate.jar:
/opt/jrun4/lib/mysql-connector-java-commercial-5.0.5-bin.jar:
/opt/jrun4/lib/oem-xdoclet.jar:
/opt/jrun4/lib/sniffer.jar:
/opt/jrun4/lib/webservices.jar:
/opt/jrun4/lib/wsconfig.jar:
/opt/jrun4/lib/wsdl2java.jar:
/opt/jrun4/lib/xmlscript.jar:
/opt/jrun4/lib/jrun.jar
Java Ext Dirs /usr/java/jdk1.6.0_14/jre/lib/ext:/usr/java/packages/lib/ext
Technical data former server (which runs well):
Operating System (uname -a):
SunOS MHPA24ZC 5.8 Generic_117350-45 sun4us sparc FJSV,GPUZC-M
Server Details
Server Product
ColdFusion MX
Version
6,1,0,hf52806_61
Edition
Enterprise
Serial Number
CED600-55949-37264-xxxxxx
Operating System
UNIX
OS Version
5.8
JVM Details
Java Version
1.4.2
Java Vendor
Sun Microsystems Inc.
Java Vendor URL
http://java.sun.com/
Java Home
/export/home/coldf/coldfusionmx/runtime/jre
File Separator
Path Separator
Line Separator
Chr(10)
User Name
coldf
User Home
/export/home/coldf
User Dir
/export/home/coldf/coldfusionmx/runtime/bin
Java VM Specification Version
1.0
Java VM Specification Vendor
Sun Microsystems Inc.
Java VM Specification Name
Java Virtual Machine Specification
Java VM Version
1.4.2-b28
Java VM Vendor
Sun Microsystems Inc.
Java VM Name
Java HotSpot(TM) Server VM
Java Specification Version
1.4
Java Specification Vendor
Sun Microsystems Inc.
Java Specification Name
Java Platform API Specification
Java Class Version
48.0
Java Class Path
/export/home/coldf/coldfusionmx/runtime/servers/lib: /export/home/coldf/coldfusionmx/runtime/servers/lib/hf52806_61.jar: /export/home/coldf/coldfusionmx/runtime/servers/lib/hf53398_61.jar: /export/home/coldf/coldfusionmx/runtime/servers/lib/hf53419_61.jar: /export/home/coldf/coldfusionmx/runtime/servers/lib/hf53486_61.jar: /export/home/coldf/coldfusionmx/runtime/servers/lib/hf53685_61.jar: /export/home/coldf/coldfusionmx/runtime/servers/lib/hf53797_61.jar: /export/home/coldf/coldfusionmx/runtime/servers/lib/hf53813_61.jar: /export/home/coldf/coldfusionmx/runtime/servers/lib/hf53852_61.jar: /export/home/coldf/coldfusionmx/runtime/servers/lib/hf54464_61.jar: /export/home/coldf/coldfusionmx/servers/lib: /export/home/coldf/coldfusionmx/lib/cfusion.jar: /export/home/coldf/coldfusionmx/lib: /export/home/coldf/coldfusionmx/lib/NetComponents.jar: /export/home/coldf/coldfusionmx/lib/bcel.jar: /export/home/coldf/coldfusionmx/lib/cf4was.jar: /export/home/coldf/coldfusionmx/lib/cf4was_ae.jar: /export/home/coldf/coldfusionmx/lib/cfmx-ssl.jar: /export/home/coldf/coldfusionmx/lib/cfmx_bootstrap.jar: /export/home/coldf/coldfusionmx/lib/cfusion.jar: /export/home/coldf/coldfusionmx/lib/cfx.jar: /export/home/coldf/coldfusionmx/lib/collections.jar: /export/home/coldf/coldfusionmx/lib/crimson.jar: /export/home/coldf/coldfusionmx/lib/flashgateway.jar: /export/home/coldf/coldfusionmx/lib/httpclient.jar: /export/home/coldf/coldfusionmx/lib/izmado.jar: /export/home/coldf/coldfusionmx/lib/jakarta-oro-2.0.6.jar: /export/home/coldf/coldfusionmx/lib/java2wsdl.jar: /export/home/coldf/coldfusionmx/lib/jaxp-api.jar: /export/home/coldf/coldfusionmx/lib/jdom.jar: /export/home/coldf/coldfusionmx/lib/ldap.jar: /export/home/coldf/coldfusionmx/lib/ldapbp.jar: /export/home/coldf/coldfusionmx/lib/log4j.jar: /export/home/coldf/coldfusionmx/lib/macromedia_drivers.jar: /export/home/coldf/coldfusionmx/lib/mail.jar: /export/home/coldf/coldfusionmx/lib/pbclient42RE.jar: /export/home/coldf/coldfusionmx/lib/pbembedded42RE.jar: /export/home/coldf/coldfusionmx/lib/pbserver42RE.jar: /export/home/coldf/coldfusionmx/lib/pbtools42RE.jar: /export/home/coldf/coldfusionmx/lib/tools.jar: /export/home/coldf/coldfusionmx/lib/tt-bytecode.jar: /export/home/coldf/coldfusionmx/lib/webcharts.jar: /export/home/coldf/coldfusionmx/lib/webchartsJava2D.jar: /export/home/coldf/coldfusionmx/lib/webservices.jar: /export/home/coldf/coldfusionmx/lib/wsdl2java.jar: /export/home/coldf/coldfusionmx/lib/xalan.jar: /export/home/coldf/coldfusionmx/runtime/lib/jrun.jar: /export/home/coldf/coldfusionmx/runtime/lib: /export/home/coldf/coldfusionmx/runtime/lib/instutil.jar: /export/home/coldf/coldfusionmx/runtime/lib/java2wsdl.jar: /export/home/coldf/coldfusionmx/runtime/lib/jrun-ant-tasks.jar: /export/home/coldf/coldfusionmx/runtime/lib/jrun-xdoclet.jar: /export/home/coldf/coldfusionmx/runtime/lib/jrun.jar: /export/home/coldf/coldfusionmx/runtime/lib/jspc.jar: /export/home/coldf/coldfusionmx/runtime/lib/migrate.jar: /export/home/coldf/coldfusionmx/runtime/lib/oem-xdoclet.jar: /export/home/coldf/coldfusionmx/runtime/lib/sniffer.jar: /export/home/coldf/coldfusionmx/runtime/lib/webservices.jar: /export/home/coldf/coldfusionmx/runtime/lib/wsconfig.jar: /export/home/coldf/coldfusionmx/runtime/lib/wsdl2java.jar: /export/home/coldf/coldfusionmx/runtime/lib/xmlscript.jar: /oracle/orav920/jdbc/lib/classes12.jar: /home5/coldf/java: /home5/coldf/java/csvjdbc.jar: /home5/coldf/java/verona: /home5/coldf/java/verona/jCO.jar: /home5/coldf/java/csvjdbc.jar: /export/home/coldf/coldfusionmx/lib/cfusion.jar
Java Ext Dirs
/export/home/coldf/coldfusionmx/runtime/jre/lib/extAnd you can use the ColdFusion Code Analyzer
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0d04c -7fee.html
But yeah, as Dan said, definitely set up a test server and plan a series of tests that must pass.
-Fernis -
Using CFHTTP to submit a form directly to a google docs form
Ok so here is some background
Google has a service where you can create forms using google docs and embed them into your webpage, Results are automatically stored in a google spreadsheet upon submission.
I want to use my own form to submit to to the google form processing page which I can get to work however the default generic google hosted thank you page appears upon submissing.
I know you can use cfhttp to submit a form from a coldfusion server so I was thinking that I could simply pass my form variables to a action page that resubmitted them via cfhttp and thus bypass the thank you page altogether
however when I try this it does not work and the results do not show up in the google spreadsheet. I figured that mabye the google processing page could tell that it was not submitted from a browser so I tired adding a useragent string but still no luck.
Here is the code I was trying to use
<cfhttp method="POST" url="https://spreadsheets.google.com/formResponse?key=tlo4FjygqMuUGmvuOb2_Gjw" redirect="yes" useragent="Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)">
<cfhttpparam type="Formfield" name="entry.0.single" value="testValue1" >
<cfhttpparam type="Formfield" name="entry.1.single" value="testValue2" >
</cfhttp>
And the online spread sheet can be viewed here
http://spreadsheets.google.com/pub?key=tlo4FjygqMuUGmvuOb2_Gjw&single=true&gid=0 &output=html
Does anyone know why this is not working?
To recap I am able to use the following form on my own comptuer to directly submit to the processing page and this works
<form action="https://spreadsheets.google.com/formResponse?key=tlo4FjygqMuUGmvuOb2_Gjw" method="POST">
<input type="text" name="entry.0.single" value="" >
<input type="text" name="entry.1.single" value="">
<input type="submit" name="submit" value="Submit">
</form>
Any help would be greatly appreciatedYES!!!!!!!!!!!!!!!!!!!!!! This did it final code is as follows thanks for you help
<cfhttp method="POST" url="https://spreadsheets.google.com/formResponse?key=tlo4FjygqMuUGmvuOb2_Gjw" useragent="Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)">
<cfhttpparam type="Formfield" name="entry.0.single" value="final test">
<cfhttpparam type="Formfield" name="entry.1.single" value="final test">
<cfhttpparam type="Formfield" name="submit" value="Submit">
</cfhttp>
Man this is great! and has eliminated half my database requirements! now only if you could pull the results back out! -
This CFHTTP works under CF5 but not CF7
Hi,
Can some one explains to me why this code works under CF5,
the page is returned in fileContent, but under CF7, the fileContent
only contains "connection failure", although the status is reported
as "200 OK".
Also, i'd appreciate if someone could test it under CF8 and
tell mes if the page is returned.
Thanks.Hi everyone, I’m experiencing a similar prob but find
that your suggested solutions don’t seem to work for me.
On my remoteserever (CF7.02). it returns 408 Request Time-out
no matter what I do. It just never connects. When submitted from my
local server (cf8 developer) I get connected everytime. I have a
friend with the same host (on a different server) and he has no
probs cfttp’ing to this url with the same code.
<cfhttp
url="
http://api.clickatell.com/http/sendmsg"
resolveurl="false"
timeout="5"
method="post"
>
<cfhttpparam type="formfield" name="api_id"
value="9999999">
<cfhttpparam type="formfield" name="user"
value="aaaaaaa">
<cfhttpparam type="formfield" name="password"
value="xxxxxx">
<cfhttpparam type="formfield" name="from"
value="61400000000">
<cfhttpparam type="formfield" name="to"
value="27999100000">
</cfhttp>
I’m not sure if it’s a compression issue or not.
I tried
<cfhttp
url="
http://api.clickatell.com/http/sendmsg"
resolveurl="false"
timeout="5"
method="post"
>
<cfhttpparam type="Header" name="Accept-Encoding"
value="deflate;q=0">
<cfhttpparam type="Header" name="TE"
value="deflate;q=0">
<cfhttpparam type="formfield" name="api_id"
value="9999999">
<cfhttpparam type="formfield" name="user"
value="aaaaaaa">
<cfhttpparam type="formfield" name="password"
value="xxxxxx">
<cfhttpparam type="formfield" name="from"
value="61400000000">
<cfhttpparam type="formfield" name="to"
value="27999100000">
</cfhttp>
AND
<cfhttp
url="
http://api.clickatell.com/http/sendmsg"
resolveurl="false"
timeout="5"
method="post"
>
<cfhttpparam type="header" name="Accept-Encoding"
value="*" />
<cfhttpparam type="Header" name="TE"
value="deflate;q=0">
<cfhttpparam type="formfield" name="api_id"
value="9999999">
<cfhttpparam type="formfield" name="user"
value="aaaaaaa">
<cfhttpparam type="formfield" name="password"
value="xxxxxx">
<cfhttpparam type="formfield" name="from"
value="61400000000">
<cfhttpparam type="formfield" name="to"
value="27999100000">
</cfhttp>
As per
http://www.talkingtree.com/blog/index.cfm/2004/7/28/20040729/
and
your suggestions only to note that none of these suggestions
permitted a successful connection from my remote host. They all
connect immediately from my local host.
I also noted Dan’s quote:
“After some more testing, it appears CFMX 7 reports the
user agent string of "CFSCHEDULE" and not "ColdFusion". This means
you should also add the "CFSCHEDULE" string along with the string
"ColdFusion" to your MIME type exceptions list. “
From:
http://blog.pengoworks.com/index.cfm/2006/3/13/CFHTTP-Connection-Failures-issues-with-Gzip
I’m not sure of the syntax to do this or if the GZIP
stuff is even relevant to my server. (Yep, I’m with Godaddy)
Anyone??? -
Cfhttp error on CF7 but not CF8 - need help
I have been battling this for a few days now, and I am starting to go a bit insane. So, I am hoping someone can offer some assistance.
I am trying to make a call to the Live Contacts API. On CF8, I can get this to work but on CF7 it throws an error:
<cfhttp url="#theURL#" method="get" result="httpResult">
<cfhttpparam type="header" name="Authorization" value="DelegatedToken dt=""#dt#""" />
<cfhttpparam type="header" name="Accept-Encoding" value="*" />
</cfhttp>
The Error:
Charset
[empty string]
ErrorDetail
I/O Exception: peer not authenticated
Filecontent
Connection Failure
Header
[undefined struct element]
Mimetype
Unable to determine MIME type of file.
Responseheader
struct [empty]
Statuscode
Connection Failure. Status code unavailable.
Text
YES
theURL and dt are dynamically created with the info returned from the consent token. This process fine and they are what they should be. But there is a difference between versions that is throwing it off. My theory is that it is a charset issue. I ran into similar with Gmail Contacts API on CF7 v CF8. I was able to get that resolved by using: charset="utf-8". However, that doesn't work for Live. <cfhttp url="#theURL#" method="get" result="httpResult" charset="utf-8">.
I have tried about every combination I can think of but still get a connection error. On CF8 servers (tested on two different ones) it worked perfect.
In googling and looking at forums, I notice this in reference to an SSL issue. I don't think that is the case here, as one of my servers doesn't have an SSL in use that would affect things. But, it is in a hosting environment, so maybe.
I think I am missing something small or some combination of headers or something. Any help would be greatly appreciated...and maybe ever rewarded with a Starbucks GC! If you have any questions or need any more info let me know.
Thanks.also sent to you on twitter:
you have:
<cfhttpparam type="header" name="Authorization" value="DelegatedToken dt=""#dt#""" />
try:
<cfhttpparam type="header" name="Authorization" value='DelegatedToken dt="#dt#"' />
note the use of single and double quotes.
not sure if that would cause it but worth a shot.
Does the Live API require that the dt be surrounded by double quotes? -
Using cfhttp to read a page and write its contents to a file.
Hi,
I am trying to get a feed of my ebay store listings to load
into froogle. Unfortunately, ebay provides the feed as a website
not a file and froogle (via GoogleBase) needs the file to be
submitted as an XML file.
Is there a way to use something like cfhttp to load up the
page where the feed is located, scan the page and write it's
contents into an XML file that I can then load up to GoogleBase???
thanks for the help.ignore me now.... I answered my own question a short while
ago.
for anyone who cares....
I used CFHTTP to get the page and then used a cffile to write
the #cfhttp.filecontent# into the new file! -
Cfhttp and setting the content-type for a request
Hi,
I am trying to set the content-type for a cfhttp request like this (on coldfusion 9):
<cfhttp redirect="no" method="get" timeout="120" url="http://10.0.0.1/test2.cfm">
<cfhttpparam type="HEADER" name="Content-Type" value="application/json; charset=utf-8">
</cfhttp>
// coding on test2.cfm:
<cfset x = GetHttpRequestData()>
<cfdump var=#x#>
// Output on test2.cfm
content
[empty string]
headers
struct
Accept-Encoding
deflate, gzip, x-gzip, compress, x-compress
Connection
TE
Host
10.0.0.1:80
Proxy-Connection
close
TE
trailers, deflate, gzip, compress
User-Agent
ColdFusion
X-REWRITE-URL
http://10.0.0.1:80/test2.cfm
method
GET
protocol
HTTP/1.1
As you can see no content-type is send through. I also tried the sniffer.exe:
GET http://10.0.0.1:80/test2.cfm HTTP/1.1
Host: 127.0.0.1
Proxy-Connection: close
Connection: TE
TE: trailers, deflate, gzip, compress
User-Agent: ColdFusion
Accept-Encoding: deflate, gzip, x-gzip, compress, x-compress
Here you can also see that no content-type was passed through. The sniffer should report back
GET http://10.0.0.1:80/test2.cfm HTTP/1.1
Host: 127.0.0.1
Proxy-Connection: close
Connection: TE
TE: trailers, deflate, gzip, compress
User-Agent: ColdFusion
Accept-Encoding: deflate, gzip, x-gzip, compress, x-compress
Content-Type: application/json; charset=utf-8
But is does not, what do i need todo to set the content-type in a cfhttp request.
Kind regards,
Nebu12Robots - are you sure about your statement that GET method requests cannot have Content-Type headers? I don't think that that is correct. I've always thought that it was valid (maybe unusual, but ...) and this W3C link weems to agree, especially in the context of its comment about what Content-Type means in a HEAD method request: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
The big problem with trying to get around the CFHTTP limitation by using the CGI scope is that the dash is illegal in a CF varname.
There is a custom tag called CFHTTP5 that getsaround a lot of the CFHTTP limitations, including cookie preservation across multiple requests. I haven't used it for a long time (CF5), but it is still actively developed. Costs $50 - http://www.cftagstore.com/tags/cfxhttp5.cfm
-reed -
Peer not authenticated error CFHTTP
Hi
I'm trying to call a web page using cfhttp. The url works fine and returns XML when called directly from the browser (any browser) but fails with the following error message when called from a .cfm file using cfhttp:
struct
Charset
[empty string]
ErrorDetail
I/O Exception: peer not authenticated
Filecontent
Connection Failure
Header
[empty string]
Mimetype
Unable to determine MIME type of file.
Responseheader
struct [empty]
Statuscode
Connection Failure. Status code unavailable.
Text
YES
Symptoms:
It's a secured url (https) so I've attempted using the port 443 (which I verified with the vendor) and a plethora of other combinations of parameters.
I was reviewing past errors like this via Google searches on different CF forums where they stated that the solution was either a bug fix from Adobe or that you needed to download the security certificate onto your own server, but all of those references were to CF9, and I'm running CF10. I've been able to use CFHTTP on other SSL protected sites and the response comes back just fine, just this particular URL. Why would this URL fail with this message and not others? And why would the url display without error from a call from a browser but not CF10?
I was also able to make the call to the page successfully using the command line tool curl.
What do I need to do with ColdFusion10 to get my CFHTTP requests to work?
Thanks in advance,
RichIf the certificates from the certificate chain are not listed as trusted in the Java key store, then the request will fail. This is the way the JVM works (which is where CF is running). If you are using a self-signed certificate or a certificate from a certificate authority that is not trusted by the JVM, then it will fail, every time.
There was also a bug in CF9 Enterprise which would sometimes result in a certificate not being accepted, but I believe that has been fixed in CF10. It was acutally a problem with a 3rd party crypto library that was included in CF enterprise.
So, chances are that you are goign to need to imort one or more certificates into the JVM keystore. You said you've already found sintructions on how to do that, so I won't rehash. If it is a self-signed cert, you will need to import that. If it is a cert with a CA parent, then you should just be able to install the CA root cert.
Hope this helps.
Jason -
Gettin 500 internal server error on cfhttp
Hi ...I have this facebook app and it use to work fine but
since a little while its not working. I have this api post and I'm
using cfhttp post and its giving me 500 internal server error but
when I do testing using form post its working fine now its this
something to do with my server config. or on facebook's side?
can someone help me please?
PatThis forum is for customization and programming of Microsoft Project - the project management scheduling product.
A quick search turned up:
https://forum.jquery.com/
I'd try there. -
Accessing a tab of a specific web page using cfhttp
Hello, CFers!
I need to access a remote page using the cfhttp. To be more specific, I need to access this page: https://sistemas.dnpm.gov.br/SCM/Extra/site/admin/dadosProcesso.aspx?numero=861738&ano=2013 (Sorry, Brazilian government sites works better only in the I.E.)
This is a site of the Brazillian government that supervises mining areas all over the country. Each mining area has its own "numero" (number) and the "ano" (year) when it was registered at the National Department of Mineral Production - DNPM agency. As you can see (if you clicked the link to the DNPM website) there's a tab "Poligonal" at the top of it. Clicking on it will start a function created probably by the ASP.NET and it will generate a PNG image showing the area and some other processes near it. Example of the link above:
So here is the problem: Can I get the data from the "poligonal" tab using the CFHTTP, knowing the poligonal page doesn't have a direct link? I tried all I could to find a way to get this image, checked I the sourcecode, but I couldn't find any way to solve my problem. That's why I came here to see if somebody can help me with this.
Sorry for my bad English. I hope you guys undertand me.
Being sure of your pacience and attention, since now I thank you.Aegis Kleais, I have tried contacting the developer, but I got no answer from him so far.
I tried something and now I can access the content that the tab shows me (with a little help of a library of Ben Nadal):
<!---
Função escrita pelo Ben Nadel
Detalhe de funcionamento em http://www.bennadel.com/blog/779-Parsing-HTML-Tag-Data-Into-A-ColdFusion-Structure.htm
--->
<cffunction name="ParseHTMLTag" access="public" returntype="struct" output="false" hint="Parses the given HTML tag into a ColdFusion struct.">
<cfargument name="HTML" type="string" required="true" hint="The raw HTML for the tag."/>
<cfset var LOCAL = StructNew() />
<cfset LOCAL.Tag = StructNew() />
<cfset LOCAL.Tag.HTML = ARGUMENTS.HTML />
<cfset LOCAL.Tag.Name = "" />
<cfset LOCAL.Tag.Attributes = StructNew() />
<cfset LOCAL.NamePattern = CreateObject("java","java.util.regex.Pattern").Compile("^<(\w+)")/>
<cfset LOCAL.NameMatcher = LOCAL.NamePattern.Matcher(ARGUMENTS.HTML) />
<cfif LOCAL.NameMatcher.Find()>
<cfset LOCAL.Tag.Name = UCase(LOCAL.NameMatcher.Group( 1 )) />
</cfif>
<cfset LOCAL.AttributePattern = CreateObject("java","java.util.regex.Pattern").Compile("\s+(\w+)(?:\s*=\s*(""[^""]*""|[^\ s>]*))?")/>
<cfset LOCAL.AttributeMatcher = LOCAL.AttributePattern.Matcher(ARGUMENTS.HTML) />
<cfloop condition="LOCAL.AttributeMatcher.Find()">
<cfset LOCAL.Name = LOCAL.AttributeMatcher.Group( 1 ) />
<cfset LOCAL.Tag.Attributes[ LOCAL.Name ] = "" />
<cfset LOCAL.Value = LOCAL.AttributeMatcher.Group( 2 ) />
<cfif StructKeyExists( LOCAL, "Value" )>
<cfset LOCAL.Value = LOCAL.Value.ReplaceAll("^""|""$","") />
<cfset LOCAL.Tag.Attributes[ LOCAL.Name ] = LOCAL.Value />
</cfif>
</cfloop>
<cfreturn LOCAL.Tag />
</cffunction>
<cfset urlDestino = "https://sistemas.dnpm.gov.br/SCM/Extra/site/admin/dadosProcesso.aspx?numero=861738&ano=201 3"/>
<!--- Primeira chamada, com o objetivo de obter os cabeçalhos e os campos ocultos para dar continuidade à navegação aqui você poderá dinamizar o resultado de acordo com o que você precisar --->
<cfhttp url="#urlDestino#" method="get" charset="utf-8" result="gResult" timeout="900"/>
<!---//OBTER O CABEÇALHO DA PÁGINA //--->
<!---capturo o cabeçalho da página e delimito em uma lista apenas os que quero passar para as páginas seguintes --->
<cfset requestHeaders = getHttpRequestData().headers/>
<cfset rhList = 'accept,accept-encoding,accept-language,cookie,cache-control,connection,pragma,user-agent '/>
<!---//OBTER OS CAMPOS OCULTOS DA PÁGINA //--->
<!--- expressão regular para localizar todos os inputs do html da página
que pode ser aprimorada para localizar apenas os hiddens --->
<cfset hiddenFields = reMatchNoCase("(?i)<input [^>]*[^>]*?>",gResult.fileContent)/>
<!--- A partir da função do Ben, eu extraio o nome e os valores dos inputs
que serão postados para a página seguinte, excluindo os valores que desviam do resultado esperado --->
<cfset formFields = []/>
<cfloop index="input" from="1" to="#arrayLen(hiddenFields)#">
<cfset inputResult = ParseHTMLTag(hiddenFields[input])/>
<cfif NOT findNoCase('btnConsultarProcesso',inputResult.ATTRIBUTES.name)
AND NOT findNoCase('btnDadosBasicos',inputResult.ATTRIBUTES.name)>
<cfset formFields[input]["name"] = inputResult.ATTRIBUTES.name/>
<cfset formFields[input]["value"] = inputResult.ATTRIBUTES.value/>
</cfif>
</cfloop>
<!---//NAVEGAR PARA PÁGINA POLIGONAL //--->
<cfhttp url="#urlDestino#" method="post" charset="utf-8" result="fResult" timeout="900">
<!--- injeta os form fields --->
<cfloop array="#formFields#" index="key">
<cfhttpparam type="formfield" name="#key.name#" value="#key.value#"/>
</cfloop>
<!--- injeta o cabeçalho--->
<cfloop collection="#requestHeaders#" index="key">
<cfif listFind(rhList,key)>
<cfhttpparam type="header" name="#key#" value="#requestHeaders[key]#"/>
</cfif>
</cfloop>
</cfhttp>
<!---//VISUALIZA A PÁGINA POLIGONAL //--->
<cfoutput>#fResult.fileContent#</cfoutput>
That's it.
And thanks for helping me! -
CF8 Use of clientCert and cfhttp
Dears,
In coldfusion 8, we are trying to implement a web service
call in secured mode (use of ssl and client certificate).
we used therefore new elements clientCert and
clientCertPassword into cfhttp command.
we received a Connection Failure as a result (coldfusion
side).
At web server of producer side (Apache), we receive an error
HTTP 400:
172.21.160.124 - - [04/Feb/2008:13:18:23 +0100] GET / 400 472
Any idea / hint would be welcome ;)
code page is attachedHi,
yes we went further. But this is not so easy.
Explanation:
Before an SSL connection can be established with CFHTTP to a
server the certificate of that server needs to be imported as a
trusted certificate in the ColdFusion truststore with the keytool
command. The command to do so is:
keytool -import -trustcacerts -keystore cacerts -storepass
<password> -noprompt -alias <alias> -file
<certfile>
If you use another CA certificate authority, then you also
have to import the CA into the ColdFusion truststore.
Before a client certificate can be used it needs to be in a
specific format, pkcs. Of course this client certificate must
contain the private key.
You also have to import the client certificate into the
Windows Certificate Store (if you run under a windows
desktop/server).
In your ColdFusion cfhttp tag, use this .pkcs certificate
file.
Tell me if it works like this :)
Maybe you are looking for
-
My iPhone 5 can no longer be recognized, therefore can't sync?
I have tried two different USB wires, and they both won't work. They use to work before, and I have tried using the wires to charge the phone by wall, and they both work fine. I also tried reinstalling (three times already) itunes, mobile device supp
-
How do i hide previous app purchases on iCloud
I went under my app store, clicked purchases and it said to hover over the app till an "X" appears on the top left but the X never showed up. Am I doing something wrong? I have a ton of old app purchases from my kid and I want to permanently get rid
-
Do I have any options or is the end near?
I have a 17" MacBookPro1,2 with 2.16 Intel Core Duo and 2GB of Memory. This thing has given me years of use but I'm pretty sure it's nearing the end. For some time I have been getting weird little video line type glitchiness every now and then. Whe
-
Hallo, ich habe gerade CS6 Upgrade von CS5.5 downgeloadet (Mac 10.7.5 über FireFox ohne Download Manager). DesignStandard_CS6_L.dmg ist vollständig (5.51 GB) downgeloadet worden. Nach dem doppel Klick bekomme ich die Meldung " DesignStandard_CS6_L n
-
OO ALV validation check without event DATA_CHANGED and results via popup
Hi Gurus, I'm working on SAP ECC 6.0 and I'm facing a problem during the ALV validation check. My requirement is to show an ALV with one editable field. In addition I have to pre-initialize this field in order to give a reference value to the user, b