HPOSSOD 1.0 Technical Note

HP Web Services for Output Server 41
Using HP Web Services for Output Server
Sample clients
client.deleteObject();
}
/**
* Delivers a single document with job attributes and document attributes
* in a single Web Service request<br>
* The deliverJob(String contract) service of HP Web Services for Output
Server is
*called.
*/
public void deliverJob(){
String deliverJobContract=
"<wsg-request>" +
/* operation-attributes
single(or multiple) destinations added to operation-attribute
tag
(In this case,WSG1,WSG2 and WSG3 are logical destinations of HP
Output Management)
*/
"<operation-attributes>" +
"<destination>WSG1</destination>"+
"<destination>WSG2</destination>"+
"<destination>WSG3</destination>"+
"</operation-attributes>"+
/*request-attributes
*Job Attributes and document attributes are added to
request-attribute tag
*/
"<request-attributes>" +
//It is Mandatory
"<document-filename>invoice.pdf</document-filename>" +// spec-
ify only file name
"<copy-count>2</copy-count>"+
"</request-attributes>"+
"</wsg-request> ";
/* Create DocumentData object, which is used to send Document to HP Web
Services for Output Server */
DocumentData data=new DocumentData();
DataHandler dh = new DataHandler(new FileData-
Source("c://invoice.pdf"));//Give complete path of the File
data.setDocument(dh);
/* call HPOS Web Service Proxy and get Response*/
String deliverJobresponse=port.deliverJob(deliverJobContract,data);
// Display Request and Response
System.out.println("deliverJobContract : "+deliverJobContract);
System.out.println("deliverJobresponse : "+deliverJobresponse);