HTTP proxy with SOAP request to non-80 port

From: Date: Sat, 12 Nov 2005 05:59:38 +0000
Subject: HTTP proxy with SOAP request to non-80 port
Groups: php.soap 
Request: Send a blank email to php-soap+get-2051@lists.php.net to get a copy of this message
I am trying to make a SOAP HTTP call via a proxy. However the endpoint is not using the standard port 80 and the proxy request is not correct. Either PEAR SOAP or HTTP Request is not passing on to the proxy the port that the request is supposed to be made for. The "Host:" header of the request is missing the port number. Is this a known problem or am I doing something wrong? Sample code for testing follows.... My versions... HTTP_Request 1.3.0 stable
SOAP           0.9.1   beta
If the following standalone test program is run, e.g. c:\php\cli\php.exe -q test.php ... <?php require_once( "SOAP/Client.php" ); $soapParams = array(
'namespace'     => 'http://foobar.com/my/namespace',
'soapaction'    => '',
'style'         => 'document',
'use'           => 'literal',
'attachments' => 'DIME',
'parameters'    => true
); $proxy = array ( 'proxy_host' => 'localhost', 'proxy_port' => '8888' ); $soap = new SOAP_Client( 'http://localhost:20000/endpoint.cgi', false, null, $proxy ); $soap->setEncoding( 'UTF-8' ); $soap->setOpt( 'timeout', 5 ); $params = array( 'inString' => 'foobar' ); $result = $soap->call( 'TestEcho', $params, $soapParams ); var_dump($result); ?> The following headers are sent to the proxy server... POST /endpoint.cgi HTTP/1.0 User-Agent: PEAR-SOAP 0.8.0RC4-devel Host: localhost Content-Type: text/xml; charset=UTF-8 Content-Length: 542 SOAPAction: "" Note that the Host: header should actually read as... Host: localhost:20000 Brodie

« previous php.soap (#2051) next »