X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2FClient.php;h=cd1491c327aef00fb80e8bb8a1fcd090327eccfe;hb=4e5288ea7f3cc91e029a9edd0ab0b9a26b72c972;hp=4e03d3e9d7bbf25f06d04ddf342e24f40292f7cd;hpb=b337d292eb5b5656d27a2fc9ab6796be300c59a3;p=plcapi.git diff --git a/src/Client.php b/src/Client.php index 4e03d3e..cd1491c 100644 --- a/src/Client.php +++ b/src/Client.php @@ -3,7 +3,7 @@ namespace PhpXmlRpc; use PhpXmlRpc\Helper\Logger; - +use PhpXmlRpc\Helper\XMLParser; /** * Used to represent a client of an XML-RPC server. */ @@ -111,7 +111,7 @@ class Client * response will be lost. It will be e.g. impossible to tell whether a particular php string value was sent by the * server as an xmlrpc string or base64 value. */ - public $return_type = 'xmlrpcvals'; + public $return_type = XMLParser::RETURN_XMLRPCVALS; /** * Sent to servers in http headers. @@ -325,7 +325,7 @@ class Client } /** - * Set attributes for SSL communication: SSL version to use. Best left at 0 (default value ): let cURL decide + * Set attributes for SSL communication: SSL version to use. Best left at 0 (default value): let cURL decide * * @param int $i */ @@ -659,7 +659,7 @@ class Client // Only create the payload if it was not created previously if (empty($req->payload)) { - $req->createPayload($this->request_charset_encoding); + $req->serialize($this->request_charset_encoding); } $payload = $req->payload; @@ -785,6 +785,7 @@ class Client $contextOptions['ssl']['verify_peer'] = $this->verifypeer; $contextOptions['ssl']['verify_peer_name'] = $this->verifypeer; } + $context = stream_context_create($contextOptions); if ($timeout <= 0) { @@ -807,6 +808,7 @@ class Client $err = error_get_last(); $this->errstr = $err['message']; } + $this->errstr = 'Connect error: ' . $this->errstr; $r = new Response(0, PhpXmlRpc::$xmlrpcerr['http_error'], $this->errstr . ' (' . $this->errno . ')'); @@ -892,7 +894,7 @@ class Client // Only create the payload if it was not created previously if (empty($req->payload)) { - $req->createPayload($this->request_charset_encoding); + $req->serialize($this->request_charset_encoding); } // Deflate request body and set appropriate request headers