X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=fs_selfservice%2Fdrupal%2Ffreeside.class.php;fp=fs_selfservice%2Fdrupal%2Ffreeside.class.php;h=cf49a03d8bfec1461d5a9eb1b91209c695f5996b;hp=161156a22ef3f730251aff5e0fc981f9113b3df2;hb=20434fef2eb78ccf1b80fdccb3a47fb04814354c;hpb=b8d1f6382bd483b4c5718a7930ea2493a1686d50 diff --git a/fs_selfservice/drupal/freeside.class.php b/fs_selfservice/drupal/freeside.class.php index 161156a22..cf49a03d8 100644 --- a/fs_selfservice/drupal/freeside.class.php +++ b/fs_selfservice/drupal/freeside.class.php @@ -1,5 +1,14 @@ URL); + public function __call($name, $arguments) { - $request = xmlrpc_encode_request("FS.ClientAPI_XMLRPC.$name", $arguments); - $context = stream_context_create( array( 'http' => array( - 'method' => "POST", - 'header' => "Content-Type: text/xml", - 'content' => $request - ))); - $file = file_get_contents($this->URL, false, $context); - $response = xmlrpc_decode($file); - if (xmlrpc_is_fault($response)) { - trigger_error("[FreesideSelfService] XML-RPC communication error: $response[faultString] ($response[faultCode])"); - } else { - //error_log("[FreesideSelfService] $response"); - return $response; - } + error_log("[FreesideSelfService] $name called, sending to ". $this->URL); + $request = xmlrpc_encode_request("FS.ClientAPI_XMLRPC.$name", + flatten($arguments[0]) + ); + $context = stream_context_create( array( 'http' => array( + 'method' => "POST", + 'header' => "Content-Type: text/xml", + 'content' => $request + ))); + $file = file_get_contents($this->URL, false, $context); + $response = xmlrpc_decode($file); + if (xmlrpc_is_fault($response)) { + trigger_error("[FreesideSelfService] XML-RPC communication error: $response[faultString] ($response[faultCode])"); + } else { + //error_log("[FreesideSelfService] $response"); + return $response; } + } }