Fix syntax error in client, make non-ssl xmlrpc work

This commit is contained in:
Miles Lott 2001-08-13 22:30:50 +00:00
parent bf3f08b0fd
commit fb00930ab8
2 changed files with 7 additions and 6 deletions

View File

@ -199,7 +199,9 @@
function _send_xmlrpc_($method_name, $args, $url, $debug=True) function _send_xmlrpc_($method_name, $args, $url, $debug=True)
{ {
list($uri,$hostpart) = $this->_split_url($url); list($uri,$hostpart) = $this->_split_url($url . $this->urlparts['xmlrpc']);
$hostpart = ereg_replace('https://','',$hostpart);
$hostpart = ereg_replace('http://','',$hostpart);
if(gettype($args) != 'array') if(gettype($args) != 'array')
{ {
$arr[] = CreateObject('phpgwapi.xmlrpcval',$args,'string'); $arr[] = CreateObject('phpgwapi.xmlrpcval',$args,'string');
@ -211,10 +213,9 @@
$arr[] = CreateObject('phpgwapi.xmlrpcval',$val, 'string'); $arr[] = CreateObject('phpgwapi.xmlrpcval',$val, 'string');
} }
} }
_debug_array($arr); $f = CreateObject('phpgwapi.xmlrpcmsg', $method_name, $arr,'struct');
$f = CreateObject('phpgwapi.xmlrpcmsg', $method, CreateObject('phpgwapi.xmlrpcval',$arr,'struct')); $this->debug("<pre>" . htmlentities($f->serialize()) . "</pre>\n",$debug);
//echo "<pre>" . htmlentities($f->serialize()) . "</pre>\n"; $c = CreateObject('phpgwapi.xmlrpc_client',$this->urlparts['xmlrpc'], $hostpart, 80);
$c = CreateObject('phpgwapi.xmlrpc_client',$this->urlparts['xmlrpc'], $uri, 80);
$c->setDebug(0); $c->setDebug(0);
$r = $c->send($f); $r = $c->send($f);
if (!$r) if (!$r)

View File

@ -95,7 +95,7 @@
} }
$op = "POST " . $this->path . " HTTP/1.0\r\nUser-Agent: PHP XMLRPC 1.0\r\n" $op = "POST " . $this->path . " HTTP/1.0\r\nUser-Agent: PHP XMLRPC 1.0\r\n"
. "Host: ". $this->server . "\r\n" . . "Host: ". $this->server . "\r\n"
. 'X-PHPGW-Server: ' . $this->server . ' ' . "\r\n" . 'X-PHPGW-Server: ' . $this->server . ' ' . "\r\n"
. 'X-PHPGW-Version: ' . $GLOBALS['phpgw_info']['server']['versions']['phpgwapi'] . "\r\n" . 'X-PHPGW-Version: ' . $GLOBALS['phpgw_info']['server']['versions']['phpgwapi'] . "\r\n"
. $credentials . $credentials