ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old October 16th, 2003, 08:50 AM
amutti amutti is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 1 amutti User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problem Loggining into ASP site w/cfhttp -- HELP!

Here is the problem. I need to log into our online payment services via CF, run a query, parse the returned html page, and finally update a database with that information. The problem is that I can't seem to login. I can login from a local html page that I submit . . . I've read some other posts here and it seems that the problem revolves around the ASP session ID? I also read that this comes in a cookie which needs to be given back to ASP on my next call? The problem is I don't think I ever get in and if I do it is never output in cfhttp.filecontent.

Here is my code

<!--- This script logs into cashnet and displays transaction information --->

<cfoutput>

<!--- First Post LOGIN TO ASP PAGE --->
<cfhttp url="https://www.myservices.com/client/signon_process.asp" method="POST" port="443" multipart="NO" userAgent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" resolveurl="YES" redirect="YES">
<CFHTTPPARAM type="HEADER" name="Host" value="www.myservices.com">
<CFHTTPPARAM type="HEADER" name="Content-Type" value="application/x-www-form-urlencoded">
<CFHTTPPARAM type="CGI" name="HTTP_ACCEPT" value="*/*">
<CFHTTPPARAM type="CGI" name="HTTP_ACCEPT_LANGUAGE" value="en">
<CFHTTPPARAM TYPE="HEADER" NAME="referer" VALUE="https://www.myservices.com/client/signon_params.asp">
<CFHTTPPARAM type="HEADER" name="Connection" value="Keep-Alive">
<cfhttpparam type="Formfield" value="/client/default.asp" name="return_to" >
<cfhttpparam type="Formfield" name="operator" value="username">
<cfhttpparam type="Formfield" name="password" value="password">
<cfhttpparam type="Formfield" name="client" value="clientname">
</cfhttp>
<!--- End First Post --->

<!--- Session/Cookie parse --->
#cfhttp.responseHeader["Set-Cookie"]#
<br>
<cfset cookiename=listfirst(cfhttp.responseHeader["Set-Cookie"],"=")>
<cfset cookievalue=listlast(listfirst(cfhttp.responseHeader["Set-Cookie"],";"),"=")>
Cookie Name= #cookiename#
Cookie Value= #cookievalue#
<br>
<!--- End Cookie Parse --->


<!--- Once in Next Post --->
<cfhttp url="https://www.myservices.com/client/inquiry/process.asp" method="POST" port="443" multipart="NO" userAgent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" resolveurl="YES" redirect="YES">
<CFHTTPPARAM type="HEADER" name="Host" value="www.myservices.com">
<CFHTTPPARAM type="HEADER" name="Content-Type" value="application/x-www-form-urlencoded">
<CFHTTPPARAM type="CGI" name="HTTP_ACCEPT" value="*/*">
<CFHTTPPARAM type="CGI" name="HTTP_ACCEPT_LANGUAGE" value="en">
<CFHTTPPARAM TYPE="HEADER" NAME="referer" VALUE="https://www.myservices.com/client/inquiry/process.asp">
<CFHTTPPARAM type="HEADER" name="Connection" value="Keep-Alive">

<!--- Send Session/Cookie back to Processing ASP --->
<cfhttpparam type="Cookie" name=cookiename value=cookievalue>
<cfhttpparam type="Formfield" name="id" value="a_certian_number">
<cfhttpparam type="Formfield" name="Tx_no" value="">
<cfhttpparam type="Formfield" name="sdate" value="9/24/2003">
<cfhttpparam type="Formfield" name="edate" value="10/24/2003">
<cfhttpparam type="Formfield" name="date_type" value="">
<cfhttpparam type="Formfield" name="item_code" value="">
<cfhttpparam type="Formfield" name="ref_type" value="">
<cfhttpparam type="Formfield" name="ref_value" value="">
<cfhttpparam type="Formfield" name="account_no" value="">
<cfhttpparam type="Formfield" name="Inquiry_amount" value="">
<cfhttpparam type="Formfield" name="Client" value="Client">
<cfhttpparam type="Formfield" name="Total" value="Total">
<cfhttpparam type="Formfield" name="Sale" value="Sale">
<cfhttpparam type="Formfield" name="Refund" value="Refund">
<cfhttpparam type="Formfield" name="Reversal" value="Reversal">
<cfhttpparam type="Formfield" name="Complete" value="Complete">
<cfhttpparam type="Formfield" name="Incomplete" value="Incomplete">
<cfhttpparam type="Formfield" name="Voided" value="Voided">
<cfhttpparam type="Formfield" name="Voided" value="Voided">
</cfhttp>
<!--- End 2nd Post --->

<!--- Display Output --->
<cfset webpage=htmlcodeformat(cfhttp.filecontent)> <!--- Setting variable to page contents for parsing --->
#cfhttp.errorDetail#
#cfhttp.header#
<!--- #cfhttp.filecontent# --->
#webpage#
<!--- End Display Output --->
</cfoutput>

Here is the returned header info.

HTTP/1.1 200 OK Content-Type: text/html PICS-Label: (PICS-1.0 "http://www.rsac.org/ratingsv01.html" l on "2003.04.30T10:13-0500" exp "2008.04.28T12:00-0500" r (v 0 s 0 n 0 l 0)) Set-Cookie: ASPSESSIONIDSCRRTACS=Blahblahblah; path=/ Date: Thu, 16 Oct 2003 13:44:47 GMT Cache-control: private Content-Length: 9304 Server: Microsoft-IIS/5.0

Any ideas???

Tony

Reply With Quote
  #2  
Old January 22nd, 2004, 07:26 AM
barth@jlab.org barth@jlab.org is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 1 barth@jlab.org User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have a similar problem did you ever solve the session login problem with cfhttp

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Problem Loggining into ASP site w/cfhttp -- HELP!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway