Hi Adam,
Well, there are next to no PHP samples out there. Its completely
possible though - about 4 years ago I built a bunch of large XMPie
backed systems that ran PHP.
You'll need to make sure you have the SOAP extension compiled into
your PHP binary. Being the moderately crappy platform that it is, PHP
needs to send the body messages to a C extension to keep it anywhere
near performant. So, if you have an install with no SOAP extension
you'll need to recompile the whole thing. There is no workaround.
The API docs will help you and tell you what methods you need to call.
But syntactically, its a doddle to port the example to whatever
language really as they are very similar. I would recommend using the
wsdl2php library found in the PEAR repository.
Consider:
<?php
// XMPIE JOB
require_once('Job.php');
require_once('job/GetStatus.php');
require_once('job/GetOutputResults.php');
class JobCheck {
public $job;
public $status_id;
public $output_filename;
private $job_id;
private $user = 'youruser';
private $pass = 'yourpass';
public function __construct($job_id){
$this->job_id = $job_id;
$this->job = new Job_SSP();
$status = new GetStatus();
$this->set_login_details($status);
$status->inJobID = $this->job_id;
$this->status_id = $this->job->GetStatus($status)-
>GetStatusResult;
}
public function get_output_filename(){
$output_name = new GetOutputResults();
if($output_name){
$this->set_login_details($output_name);
$output_name->inJobID = $this->job_id;
return $this->job->GetOutputResults($output_name)-
>GetOutputResultsResult;
}
}
private function set_login_details($obj){
$obj->inUsername = $this->user;
$obj->inPassword = $this->pass;
}
}
The only thing i've found to date that is a complete and utter
nightmare with PHP is binary streaming... in the runtime, $whatever =
'xxx' is actually a transitory char stream, not a concrete type (go
figure!?). This makes serialising anything to/from a byte array next
to impossible. Bloody PHP.
Good luck.
Tim