HTTP proxy with SOAP request to non-80 port

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux