• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Mar 14, 2008 Mar 14, 2008

Copy link to clipboard

Copied

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!
TOPICS
Advanced techniques

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 14, 2008 Mar 14, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 16, 2008 Mar 16, 2008

Copy link to clipboard

Copied

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!




Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 16, 2008 Mar 16, 2008

Copy link to clipboard

Copied

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>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 17, 2008 Mar 17, 2008

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 17, 2008 Mar 17, 2008

Copy link to clipboard

Copied

still doesnt work... same error message.

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 17, 2008 Mar 17, 2008

Copy link to clipboard

Copied

still doesnt work... Statuscode 200 OK

That looks like a contradiction to me.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 18, 2008 Mar 18, 2008

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 18, 2008 Mar 18, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 18, 2008 Mar 18, 2008

Copy link to clipboard

Copied

NocturnalQueen85 wrote:
no, there is no connection failure.

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






Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 26, 2008 Mar 26, 2008

Copy link to clipboard

Copied

LATEST
thanks guys!
i pass in the cookies as header and now it works!

thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation