HPOSSOD 1.0 Technical Note
HP Web Services for Output Server 44
Using HP Web Services for Output Server
Sample clients
// send Doc1 complete
/* Send Doc2*/
// create sendDocument Contract
sendDocumentContract=
"<wsg-request>" +
/* 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=false(Not Mandatory)
"<last-document>false</last-document>"+
//Add MD5 checksum(Not Mandatory)
// Get MD5 Hash Value
"<document-checksum>"+getMD5Hex(doc2)+"</document-checksum>"+
"</operation-attributes>"+
/*request-attributes
*Document Attributes are added to request-attribute tag
*/
"<request-attributes>" +
//It is Mandatory
"<document-filename>invoice.pdf</document-filename>" +// spec-
ify only file name(here doc2=invoice.pdf)
"<copy-count>2</copy-count>"+
/* Add other document-attributes Here
*/
"</request-attributes>"+
"</wsg-request> ";
/* Create DocumentData Object and set file */
DocumentData doc2Data = new DocumentData();
DataHandler doc2_dh = new DataHandler(new FileDataSource(doc2));
doc2Data.setDocument(doc2_dh);
/* call HPOS Web Service Proxy and get Response*/
sendDocumentResponse=port.sendDocument(sendDocumentContract,doc2Data);
//print sendDocument Request and response
System.out.println("sendDocumentContract 2 : "+sendDocumentContract);
System.out.println("sendDocumentResponse 2 : "+sendDocumentResponse);
// send Doc2 complete
/* Send Doc3*/
// create sendDocument Contract
sendDocumentContract=
"<wsg-request>" +