Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-28-2008, 04:12 PM
Junior Member
 
Join Date: Jun 2008
Posts: 1
Question Zend_http_client failed to connect when setParameterPost is used

Hi,

I am a newbie in zend framework. I developed an application which connects to second application which is also build in zend framework for authentication. The code looks like this

include_once 'Zend/Http/Client.php';

$this->_kioskClient = new Zend_Http_Client( $app_url . '/authenticator');

$this->_kioskClient->setCookieJar()->setParameterPost('username', 'admin')->setParameterPost('password', 'admin');

try{
$response = $this->_kioskClient->request('POST');
} catch (Zend_Exception $e){
$this->_error[] = $e->getMessage();
}

When I run this code, the app show an error "Unable to Connect to tcp://localhost:80. Error #10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond". But when i took off the setParameterPost('username', 'admin') and setParameterPost('password', 'admin'), it works. But authentication wont work as there is no username and password.

My system is running vista and firefox3. Funny thing is, this app is running in a machine with WinXp and firefox2. When I ported this to vista machine the app failed. Not sure if this happened because of another vista security issue.

If anyone had encountered this problem, or have a solution to this please let me know.

Thanks in advance.

Last edited by sendecruz : 06-29-2008 at 09:06 AM. Reason: correction
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-10-2008, 03:25 PM
Junior Member
 
Join Date: Jun 2008
Location: Wales
Posts: 7
Default Is localhost the problem?

I've been having the same problem when I try to use Http_Client to send a simple GET request to a "localhost" URL.

Try replacing "localhost" with teh IP address for your target server e.g. 127.0.0.1 is the usual "localhost" default address.

Well, it worked for me...

Chris
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:02 AM.