[xmpie-users] XMPie Integration with PHP

428 views
Skip to first unread message

Adam

unread,
May 10, 2010, 12:07:44 PM5/10/10
to XMPie Interest Group
Hi Everyone,

I'm a somewhat experienced PHP developer and have been tasked with
writing a site to interact with our client's XMPie server via the
API. I am completely new to XMPie and have little experience with
SOAP and some of the web service functionality.

If anyone knows of any examples of PHP code or can help get me started
that would be great. I have the API docs and have been scouring the
web for some PHP examples but have found virtually nothing (except for
one thread on here which has helped me get started). Initially I need
to make a call to generate a proof, get that proof and display it on
the website, and then eventually call to execute the production of
that art piece.

Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "XMPie Interest Group" group.
To post to this group, send email to xmpie...@googlegroups.com.
To unsubscribe from this group, send email to xmpie-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xmpie-users?hl=en.

Timothy Perrett

unread,
May 10, 2010, 12:32:00 PM5/10/10
to XMPie Interest Group
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

Adam

unread,
May 11, 2010, 5:18:57 PM5/11/10
to XMPie Interest Group
Thanks very much for you input Tim,

With your example and the other I've gotten my hands around making
calls to the server and getting actions going.

My next problem relates to referencing a .csv data source that's on
another server (or transferring it to the XMPie server).

What we're trying to do is this:

1. Create a datafile on our linux server running in PHP
2. Submit a proof request to a remote XMPie server using the datafile
on the original server
3. Retrieve the proof from the XMPie server and display it on the
original linux server in our website

Anyone have any ideas on that? My understanding of the documentation
is that the datasource needs to be local... If that's the case. Is
there any way to transfer it and create a linking data source object
in XMPie?

Adam

couch

unread,
May 12, 2010, 12:08:20 AM5/12/10
to XMPie Interest Group
I believe that you are correct that the csv file needs to be local.
You might also be able to map a drive on the server, to the location
on your linux server which has the csv.

To use the datafile, you first create a RecipientsInfo stucture, and
also a Connection structure. These define the data source type and
connection string. You can then apply these to the job ticket you are
creating to do the proof using the SetRI method.

I suggest that you refer to the XMPie API SDK which should be in your
install disks, or obtainable from XMPie support. The SDK contains the
API documentation and also several examples in VB and C#. I know you
are developing in PHP, but the examples will still help you understand
the process or methodology behind them...
Reply all
Reply to author
Forward
0 new messages