1 5 package demo.handlers.common; 6 7 import java.io.FileOutputStream ; 8 import java.io.IOException ; 9 import java.io.PrintStream ; 10 11 import java.util.Map ; 12 import java.util.Set ; 13 14 import javax.xml.namespace.QName ; 15 import javax.xml.ws.handler.soap.SOAPMessageContext; 16 17 21 public class FileLoggingHandler extends LoggingHandler { 22 23 public FileLoggingHandler() { 24 try { 25 setLogStream(new PrintStream (new FileOutputStream ("demo.log"))); 26 } catch (IOException ex) { 27 System.err.println("Could not open log file demo.log"); 28 } 29 } 30 31 public void init(Map c) { 32 System.out.println("FileLoggingHandler : init() Called...."); 33 } 34 35 public Set <QName > getHeaders() { 36 return null; 37 } 38 39 public boolean handleMessage(SOAPMessageContext smc) { 40 System.out.println("FileLoggingHandler : handleMessage Called...."); 41 logToSystemOut(smc); 42 return true; 43 } 44 45 public boolean handleFault(SOAPMessageContext smc) { 46 System.out.println("FileLoggingHandler : handleFault Called...."); 47 logToSystemOut(smc); 48 return true; 49 } 50 } 51 | Popular Tags |