2017

Table Of Contents
USING QUARKXPRESS SERVER
A Guide to QuarkXPress Server 2017 | 189
Get a reference to the AdminService:4.
AdminService adminService = new AdminServiceStub(
“http://[server]:[port]/qxpsm/services/AdminService”);
Use these two services to make requests.5.
For sample code, see the following topics.
If QuarkXPress Server Manager is running over SSL,the client-side application must
also use SSL. Invoke NoValidationTrustProvider.install(), where
install() is the static method of the Java class NoValidationTrustProvider
(provided with the Java samples).
Java sample: Deconstructing a project
QRequestContext qRequestContext = new QRequestContext();
qRequestContext.setDocumentName(“MyDoc.qxp”);
// Create XML Request
XMLRequest xmlRequest = new XMLRequest();
qRequestContext.setRequest(xmlRequest);
// Get reference to RequestService
RequestService service = new RequestServiceStub(
“http://<server>:<port>/qxpsm/services/RequestService”);
//Process Request using request service
QContentData data = service.processRequest(qRequestContext);
String deconstructXml = data.getTextData();
Java sample: Rendering a PDF
QRequestContext qRequestContext = new QRequestContext();
qRequestContext.setDocumentName(“MyDoc.qxp”);
// Setting responseAsURL to true generates the response as a URL
qRequestContext.setResponseAsURL(true);
// Create the PDFRenderRequest
PDFRenderRequest pdfRenderRequest = new PDFRenderRequest();
qRequestContext.setRequest(pdfRenderRequest);
// Get reference to RequestService
RequestService service = new RequestServiceStub(
“http://<server>:<port>/qxpsm/services/RequestService”);
// Process request using RequestService
QContentData data = service.processRequest(qRequestContext);
// Get URL from which resulting PDF can be fetched
String pdfUrl = data.getResponseURL();
Java sample: Chained request
QRequestContext qRequestContext = new QRequestContext();
qRequestContext.setDocumentName(“Project.qxp”);
// QXP doc render request
QuarkXPressRenderRequest qxpreq = new QuarkXPressRenderRequest();
// Save as request that saves the file
SaveAsRequest saveAsRequest= new SaveAsRequest();