1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| @WebService(name = "Composition", serviceName = "CompositionService")
public class Composition {
/**
* Default constructor.
*/
public Composition() {
// TODO Auto-generated constructor stub
}
@WebMethod()
public long engineVersionCount() {
return 17; // FIXME utiliser le fichier de configuration
}
@WebMethod(operationName = "composer")
@WebResult(name = "document")
public Response composer(
@WebParam(name = "id", header = true) String idISA,
@WebParam(name = "version", header = true) int versionFlux,
...,
@WebParam(name = "xml", mode = WebParam.Mode.OUT) Holder<byte[]> XML)
throws IOException {
File resultat = new File(
"D:/compositionTP/CompositionTP/ressources/doc.pdf");
byte[] test = new byte[2];
test[0] = 1;
test[1] = 0;
XML = new Holder<byte[]>(test);
String idComposition = idISA + "comp";
Response rep = new Response(resultat, idISA, idComposition);
return rep;
}
}
@XmlType(name = "response", propOrder = { "idDemande", "idComposition",
"document" })
@XmlAccessorType(XmlAccessType.FIELD)
public class Response {
@XmlElement(name = "document", type = Byte.class)
private byte[] document = null;
private String idDemande = null;
private String idComposition = null;
...
} |