HPOSSOD 1.0 Technical Note

HP Web Services for Output Server 46
Using HP Web Services for Output Server
Sample clients
*4)Call createDocument(String documentContract) API and get DocumentHan-
dle<br>
*Use this DocumentHandle to send document in chunks<br>
*5)Create ChunkContract with chunk related attributes<br>
*6)Call mutiple times sendChunk(String chunkContract DocumentData chunk-
Data) API to send documents in chunk<br>
*/
public void sendDocumentWithChunks()throws Exception{
//Here we are sending single document with chunks
String doc="c:\\invoice.pdf";
//create job contract
String createJobContract=
"<wsg-request>" +
/* operation-attributes
single(or multiple) destinations added to operation-attribute
tag
(here WSG1,WSG2 and WSG3 are Logical destinations of HPOM)
*/
"<operation-attributes>" +
"<destination>WSG1</destination>"+
"<destination>WSG2</destination>"+
"<destination>WSG3</destination>"+
"</operation-attributes>"+
/*request-attributes
*Job Attributes are added to request-attribute tag
*/
"<request-attributes>" +
"<copy-count>2</copy-count>"+
"</request-attributes>"+
"</wsg-request> ";
//call createJob() API
String createJobResponse=port.createJob(createJobContract);
//print createJob Request and Response
System.out.println("createJobContract : "+createJobContract);
System.out.println("createJobResponse : "+createJobResponse);
/* Parse the createJobResponse and get Jobhandle*/
//here we are using Parser Object
Parser parser=new Parser(createJobResponse);
// Parse operational-attributes tag and get JobHandle
AttributeSet aset=parser.parseDocument("operation-attributes");
String jobHandle=aset.getValue("wsg-job-handle");
System.out.println("jobHandle : "+jobHandle);
/*we can use this jobHandle to send multiple documents*/
String documentContract=
"<wsg-request>" +