Ask a Question related to Macromedia ColdFusion, Design and Development.
-
cfmichael #1
CFHTTP
Hello, I need to send data from a CF page to an asp.net page for processing
via a URL string. The ASP page takes three parameters. Those being Event
Title, startDate and EndDate. My first attempt is to send the data via cfhttp
and the following is the code. This does not seem to work. Any suggestions.
<cfhttp
url='http://miketest/_layouts/ooc_/WebForm1.aspx?Event_Title=SammyTest1&Sta
rtDate=04/10/2005&EndDate=04/12/2005' method='get' delimiter=','
resolveurl='yes' throwonerror='yes'> </cfhttp>
cfmichael Guest
-
CFHTTP Put Method
Scenario is one in which I am moving image files from a local laptop running CF Developer Server to a centralized CF Enterprise server. Have been... -
Cfhttp problem
Im trying to loop through an array elements (in this case URLs) using cfhttp, there are several elements in the array but I can only cfhttp the... -
cfhttp erro
I have been trying to read a tab delimited text file with cfhttp get and I keep getting this error - The column name '<!DOCTYPE HTML PUBLIC... -
cfhttp error
Ugh - I give up. Hi. I have the following line of code: <cfhttp url='#appFullPath#temp_sfiles/#session.userid#/#name#' method='head' /> When I... -
CFHTTP help
We have an in-house built publication system that creates .htm files from database content. For a specific project, I need to modify the way that... -
Mr Black #2
Re: CFHTTP
'/' in the query string could be a problem. Try to use URLEncodedFormat().
Mr Black Guest
-
reya276 #3
CFHTTP
I was wondering if anyone can look at my code and see if it's incorect, because
right now I'm passing some parameters to 2checkout and it's not working so I'm
wondering if it's even possible to do a cfloop within an cfhttp? please let me
know if it's possible. thanks.
----------- Code ------------
<cfhttp Method="POST" URL="https://www.2checkout.com/2co/buyer/purchase"
port="443" resolveurl="yes" redirect="yes">
<cfhttpparam name="sid" type="FormField" value="#FORM.sid#">
<cfloop index="loopcount" from="1" to="#ArrayLen(session.cart)#">
<cfhttpparam name="c_prod_#loopcount#" type="FormField"
value="#session.cart[loopcount][3]#">
<cfhttpparam name="c_name_#loopcount#" type="FormField"
value="#session.cart[loopcount][1]#">
<cfhttpparam name="c_price_#loopcount#" type="FormField"
value="#NumberFormat(session.cart[loopcount][2],'_____.__')#">
<cfhttpparam name="c_description_#loopcount#" type="FormField" value="none">
<cfhttpparam name="total" type="FormField"
value="#NumberFormat(total,'_____.__')#">
<cfhttpparam name="id_type" type="FormField" value="1">
<cfhttpparam name="c_tangible_#loopcount#" type="FormField" value="y">
</cfloop>
<cfhttpparam name="sh_cost" type="FormField"
value="#NumberFormat(FORM.shipping_amount,'_____._ _')#">
<cfhttpparam name="demo" type="FormField" value="#FORM.demo#">
<cfhttpparam name="card_holder_name" type="FormField"
value="#FORM.card_holder_name#">
<cfhttpparam name="street_address" type="FormField"
value="#FORM.street_address#">
<cfhttpparam name="city" type="FormField" value="#FORM.city#">
<cfhttpparam name="state" type="FormField" value="#FORM.state#">
<cfhttpparam name="country" type="FormField" value="#FORM.country#">
<cfhttpparam name="zip" type="FormField" value="#FORM.zip#">
<cfhttpparam name="phone" type="FormField" value="#FORM.phone#">
<cfhttpparam name="email" type="FormField" value="#FORM.member_email#">
</cfhttp>
reya276 Guest
-
jdeline #4
Re: CFHTTP
I'm not sure if you can put a CFLOOP inside a CFHTTP. You might build your
CFHTTPPARAMs outside the CFHTTP.
<CFSET params = "">
<CFLOOP index="loopcount" from"1" to="#arrayLen(session.cart)#">
<CFSET params = params & "<cfhttpparam name=" & Chr(34) & "c_prod_" &
loopcount & Chr(34) & " type="
& Chr(34) & "FormField" & Chr(34) & " value=" &Chr(34) &
session.cart[loopcount][3] & Chr(34) & ">">
<!--- repeat for the other cfhttpparams in the loop --->
</CFLOOP>
<cfhttp Method="POST" URL="https://www.2checkout.com/2co/buyer/purchase"
port="443" resolveurl="yes" redirect="yes">
<cfhttpparam name="sid" type="FormField" value="#FORM.sid#">
#params#
<cfhttpparam name="sh_cost" type="FormField"
value="#NumberFormat(FORM.shipping_amount,'_____._ _')#">
<cfhttpparam name="demo" type="FormField" value="#FORM.demo#">
<cfhttpparam name="card_holder_name" type="FormField"
value="#FORM.card_holder_name#">
<cfhttpparam name="street_address" type="FormField"
value="#FORM.street_address#">
<cfhttpparam name="city" type="FormField" value="#FORM.city#">
<cfhttpparam name="state" type="FormField" value="#FORM.state#">
<cfhttpparam name="country" type="FormField" value="#FORM.country#">
<cfhttpparam name="zip" type="FormField" value="#FORM.zip#">
<cfhttpparam name="phone" type="FormField" value="#FORM.phone#">
<cfhttpparam name="email" type="FormField" value="#FORM.member_email#">
</cfhttp>
jdeline Guest
-
Kronin555 #5
Re: CFHTTP
I do <cfloop...>s inside <cfhttp> and it works fine. That's not the problem.
Kronin555 Guest
-
Stressed_Simon #6
Re: CFHTTP
The problem is that the cfhttp opens the connection and the cfhttpparam sends
over the form fields. Everytime you loop over the cfhttpparams you are writing
over the formfields form the last iteration of the loop. You must cloop the
entire cfhttp statement as these will be individual connections and wont
overwrite one another.
I must add this does look like a bit of a backward way to communicate what
looks like a shopping carts contents. Are you sure you need to be going about
it in this manner?
Stressed_Simon Guest
-
Kronin555 #7
Re: CFHTTP
Simon is right on one thing, the "total" and "id_type" fields are being
overwritten. All your other fields are fine, as they are appending the
#loopcount# to the form field name and are therefore unique.
I'm not sure what <cfhttp..> does when you try to call it with multiple
<cfhttpparam..>s with the same name. Maybe you just forgot to append
_#loopcount# to the total and id fields?
Kronin555 Guest
-
reya276 #8
Re: CFHTTP
Well it is a shopping cart contents, but I had to resort to this because I
don't think I have another way of doing this without using client site
scripting which I don't want to get into, that being said I was actually
sending the information as a URL string but things got complicated when they (2
checkout) started demanding that I send all the actual product information and
since I cannot do a <cfloop> within <cflocation URL> tag, unless I can and if
this is the case I would apperciate if you guys can provide an example of it or
point me to some sites where I can get some examples of it. Thanks for the help
guys.
reya276 Guest
-
robstacey #9
CFHTTP
I am trying to use CFHTTP's get method to read a text file.
What I would like to do is begin reading the file at some other line than the
first (or the second). Is there some way that I can do this?
Thanks in advance.
robstacey Guest
-
Ro #10
Re: CFHTTP
You can loop through the file and have the delimiter set to
#Chr(10)##Chr(13)#
If that doesn't work, reverse the order to #Chr(13)##Chr(10)# I forget
which is which.
You're basically looping through the windows newline characters in the
text file.
On Wed, 8 Jun 2005 14:03:21 +0000 (UTC), "robstacey"
<webforumsuser@macromedia.com> wrote:
>I am trying to use CFHTTP's get method to read a text file.
>
> What I would like to do is begin reading the file at some other line than the
>first (or the second). Is there some way that I can do this?
>
> Thanks in advance.Ro Guest
-
vineet1980 #11
CFHTTP
Hi All,
I am facing some problem in calling <cfhttp tag in my application which is got
migrated from ColdFusion 5 to ColdFusion MX unix server. The application code
was running fine ColdFusion 5 which was a windows server. Whenever my
application calls cfhttp tag it gives me the error "Connection Failure : Status
Code Unavailable". The same code was running fine in one of my ColdFusion MX
windows server. It looks to me some problem related on unix server. Also my
application runs on secure shell environment.
I will be very thankful if somebody from the group could provide me any help
on this problem.
Thanks in advance!!!
Thanks
Vineet
vineet1980 Guest
-
CutterBl #12
Re: CFHTTP
Secure shell environment? Does this mean that the cfmx install is only available over port 443? So maybe port 80 (the default) is blocked by a firewall or something?
CutterBl Guest
-
-
vineet1980 #14
Re: CFHTTP
Hi,
Please find attached code snippets :
<cfhttp throwonerror="Yes" timeout="5200" resolveurl="Yes" redirect="No"
METHOD="POST"
URL="#application.vars.absoluteURL#CoGenT/index.cfm?cfid=#cfid#&cftoken=#cftok
en#"
PATH="#application.vars.FilePath#"
FILE="#variables.fileName#">
<CFHTTPPARAM type="formfield" name="fuseaction" value="reports:PrintRpts">
<CFHTTPPARAM type="formfield" name="email_format" value="HTML">
<cfloop
list="ReportID,rpt_CRO_ID,rpt_contract_id,WO_Typ,C RO_ID,contract_id,rpt_typ,Awar
ded_Start,Awarded_End" index="key">
<cfif isdefined("attributes.#key#")>
<cfset tmp=evaluate("attributes.#key#")>
<CFHTTPPARAM type="formfield" name="#key#" value="#tmp#">
</cfif>
</cfloop>
</cfhttp>
The above code is working fine in ColdFusion 5 in windows server. The
application is running on secure shell environment on unix server. I have tried
to give port no as 443 as attribute in <cfhttp tag but it doesn't worked. If
you have any solution then please let me know.
Thanks in advance.
Thanks,
Vineet
vineet1980 Guest
-
BKBK #15
Re: CFHTTP
> The same code was running fine in one of my ColdFusion MX windows
Here I thought immediately of case-sensitivity. Have you ruled that out?> server. It looks to me some problem related on unix server.
BKBK Guest
-
BKBK #16
Re: CFHTTP
You will see from the
[url]http://livedocs.macromedia.com/coldfusion/7/htmldocs/00000272.htm[/url] that there
have been changes in the functionality of the tag since CF5. One example is the
addition of the charset attribute. Setting it to "utf-8" has been known
to cure similar problems.
BKBK Guest
-
vineet1980 #17
Re: CFHTTP
Hi,
I have checked there is no issue with case senstivity in unix server. I have
also tried to give charset as utf-8 which is default charset in ColdFusion MX
and iso-8859 for ColdFusion 5 . But none of these worked. I have also tried to
use <cfhttpparam for providing charset information but that also doesn't
worked. I will be very thankful, if you could please provide me some pointers
in solving this problem.
Thanks in advance.
Thanks,
Vineet
vineet1980 Guest
-
BKBK #18
Re: CFHTTP
And [url]http://www.talkingtree.com/blog/index.cfm?mode=entry&entry=25AA75A4-45A6-2844-7CA3EECD842DB576?[/url]
BKBK Guest
-
vineet1980 #19
Re: CFHTTP
Hi,
I tried a simple code of cfhttp and trying to read a static cfm but it gives
me error as "Status Code Unavailable" on windows server. I am cfhttp to
authenticate the user from My LSSO server and able to authenticate user. But
when I am trying to read a .cfm file it is giving me a error "Connection
Failure: Status code unavailable". I have used the below code :
<cfhttp throwonerror="Yes" timeout="5200" resolveurl="Yes" redirect="No"
METHOD="POST"
URL="http://finapp1-d.am.lilly.com/porecon/footer.cfm">
<CFHTTPPARAM type="formfield" name="fuse" value="hello">
</cfhttp>
Please suggest what I need to do so that code will work fine.
Thanks in advance.
Vineet Marwah
vineet1980 Guest
-
DaveyS #20
Re: CFHTTP
Can you access that URL in a browser?
I can't even PING that server
Pinging finapp1-d.am.lilly.com [40.2.254.137] with 32 bytes of data:
Request timed out.
Reply from hidden.hidden.231.3: Destination net unreachable.
Request timed out.
DaveyS Guest



Reply With Quote

