HPOSSOD 1.0 Technical Note

HP Web Services for Output Server 45
Using HP Web Services for Output Server
Sample clients
/* In operation-attributes
*Add wsg-job-handle,last-document and document-checksum tags
*/
"<operation-attributes>" +
//Added job Handle(Mandatory)
"<wsg-job-handle>"+jobHandle+"</wsg-job-handle>" +
// add last-document=true since it is the last document(Manda-
tory)
// if last-document=true all the documents delivers to the des-
tinations and job completes
"<last-document>true</last-document>"+
//Add MD5 checksum(Not Mandatory)
// Get MD5 Hash Value
"<document-checksum>"+getMD5Hex(doc3)+"</document-checksum>"+
"</operation-attributes>"+
/*request-attributes
*Document Attributes are added to request-attribute tag
*/
"<request-attributes>" +
//It is Mandatory
"<document-filename>sample.xml</document-filename>" +// specify
only file name(here doc3=sample.xml)
"<copy-count>2</copy-count>"+
/* Add other document-attributes Here
*/
"</request-attributes>"+
"</wsg-request> ";
/* Create DocumentData Object and set file */
DocumentData doc3Data = new DocumentData();
DataHandler doc3_dh = new DataHandler(new FileDataSource(doc3));
doc3Data.setDocument(doc3_dh);
/* call HPOS Web Service Proxy and get Response*/
sendDocumentResponse=port.sendDocument(sendDocumentContract,doc3Data);
//print sendDocument Request and response
System.out.println("sendDocumentContract 3 : "+sendDocumentContract);
System.out.println("sendDocumentResponse 3 : "+sendDocumentResponse);
// send Doc3 complete
}
/**
* Send big document(s) using chunking machanism.<br>
*Steps<br>
*1)Create jobContract with all job attributes<br>
*2)Call createJob(String jobContract) API and get a JobHandle<br>
*Use the JobHandle to deliver single document or multiple documents with
chunks<br>
*3)Create DocumentContract with all document attributes<br>