Skip to main content
Participant
March 14, 2008
Question

Connection failure error when using cfhttp to a asp.net site

  • March 14, 2008
  • 6 replies
  • 1523 views
Hi guys,

i've encountered connection failure error when using cfhttp to a asp.net site.

However, when i access the site on the browser it's working fine.

here is the codes:

<cfhttp url=" http://XXX/login.aspx" 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="Accept-Encoding" Value="*">
<cfhttpparam type="Header" name="TE" value="deflate;q=0">
<cfhttpparam type="Formfield" name="password" value="XXX">
<cfhttpparam type="Formfield" name="email" value="XXXX">
</cfhttp>


Pls help

thanks!
This topic has been closed for replies.

6 replies

Participant
March 27, 2008
thanks guys!
i pass in the cookies as header and now it works!

thanks!
BKBK
Community Expert
Community Expert
March 18, 2008
NocturnalQueen85 wrote:
no, there is no connection failure.

Then telling the forum you obtained "same error message" was quite misleading.






BKBK
Community Expert
Community Expert
March 18, 2008
still doesnt work... Statuscode 200 OK

That looks like a contradiction to me.


Participant
March 18, 2008
no, there is no connection failure.
however, it points back to the login page of the third party so i concluded i still couldnt login.

thanks
Participating Frequently
March 18, 2008
Try to set redirect="NO" to see whether you are being redirected after the login page. You obviously do not need resolveurl="yes", even it doesn't hurt.

Assuming that everyhting else is correct, most likely you receive a re-direct response with cookie set. So that next page checks whether you logged-in or not. If so, you have to manually process that re-direct in order to provide cookie to the next page.
BKBK
Community Expert
Community Expert
March 17, 2008
still doesnt work... same error message.

Do you mean you are still getting a "connection failure"?

BKBK
Community Expert
Community Expert
March 17, 2008
What about this:

<cfhttp url=" http://XXX/login.aspx" method="POST" resolveurl="YES" redirect="YES">
<cfhttpparam type="Header" name="Accept-Encoding" Value="deflate;q=0">
<cfhttpparam type="Header" name="TE" value="deflate;q=0">
<cfhttpparam type="Formfield" name="password" value="XXX">
<cfhttpparam type="Formfield" name="email" value="XXXX">
</cfhttp>


Participant
March 17, 2008
nope.

still doesnt work... same error message.

attaches is the cfdump of cfhttp

Charset utf-8

ErrorDetail [empty string]

Header HTTP/1.1 200 OK Date: Mon, 17 Mar 2008 07:14:02 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Vary: Accept-Encoding Cache-Control: private X-AspNet-Version: 2.0.50727 Content-Type: text/html; charset=utf-8

Mimetype text/html

Responseheader struct
Cache-Control private
Content-Type text/html; charset=utf-8
Date Mon, 17 Mar 2008 07:14:02 GMT
Explanation OK
Http_Version HTTP/1.1
Server Microsoft-IIS/6.0
Status_Code 200
Vary Accept-Encoding
X-AspNet-Version 2.0.50727
X-Powered-By ASP.NET

Statuscode 200 OK

Text YES


thanks!
Inspiring
March 15, 2008
Could it be you are using port 443 which is the SSL port but your URL property is going to an HTTP not an HTTPS address?

If indeed you are posting to an HTTPS url and you are getting a connection failure it is because you need to import the destination sites' SSL certificate into your keystore. That is a real pain in the butt and I do not understand why you need to do that in Coldfusion.
Participant
March 17, 2008
sorry about the port=443. i was just trying out different codes to see whether it works.
there is no SSL thus no need for port=443.

and the thrid party said i must use POST and i tried using this code below and im still having the same problem.

this is my latest version of the code:

<cfhttp url=" http://XXX/login.aspx" method="POST" multipart="NO" userAgent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" resolveurl="YES" redirect="YES">
<cfhttpparam type="Header" name="Accept-Encoding" Value="*">
<cfhttpparam type="Header" name="TE" value="deflate;q=0">
<cfhttpparam type="Formfield" name="password" value="XXX">
<cfhttpparam type="Formfield" name="email" value="XXXX">
</cfhttp>

pls help! thanks alot!