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=161156a22ef3f730251aff5e0fc981f9113b3df2;hp=0000000000000000000000000000000000000000;hb=3706609762d9cec964f337e74829031b895ddbac;hpb=d1c3bdca8b00a5accace9121edabc675698af001 diff --git a/fs_selfservice/drupal/freeside.class.php b/fs_selfservice/drupal/freeside.class.php new file mode 100644 index 000000000..161156a22 --- /dev/null +++ b/fs_selfservice/drupal/freeside.class.php @@ -0,0 +1,33 @@ +URL = 'http://' . variable_get('freeside_hostname','') . ':8080'; + $this; + } + + public function __call($name, $arguments) { + + error_log("[FreesideSelfService] $name called, sending to ". $this->URL); + + $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; + } + } + +} + +?>