Guest User

Untitled

a guest
Jan 23rd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. @MTOM(enabled= true)
  2. public class Mtomservice{
  3. @SuppressWarnings("finally")
  4. public Response getResponse (byte[] arg0) {
  5. Response response = new Response ();
  6. try{
  7. String filePath = WebServiceBase.getCurrentSession().getEnvironmentString("Directory", true)+"/PretenzMtom_3.pdf";
  8. FileOutputStream fileOut = new FileOutputStream(new File(filePath));
  9. fileOut.write(arg0);
  10.  
  11.  
  12. response.setResponseststus("OK");
  13.  
  14. } catch (Exception e) {
  15. e.printStackTrace();
  16. response.setResponseststus("error");
  17. StringWriter errors = new StringWriter();
  18. e.printStackTrace(new PrintWriter(errors));
  19.  
  20. response.setResponseErrorText(errors.toString());
  21.  
  22. }
  23.  
  24. finally {
  25. return response;
  26. }
  27.  
  28. }
Add Comment
Please, Sign In to add comment