@@ -0,0 +1,1988 @@
+package jp.co.flect.soap.event;%0D%0A%0D%0Aimport jp.co.flect.xml.XMLUtils;%0D%0Aimport jp.co.flect.soap.SoapFaultException;%0D%0Aimport jp.co.flect.log.LoggerFactory;%0D%0Aimport jp.co.flect.log.Logger;%0D%0A%0D%0Aimport java.util.List;%0D%0Aimport java.util.ArrayList;%0D%0Aimport org.w3c.dom.Document;%0D%0Aimport org.xml.sax.SAXException;%0D%0Aimport java.io.IOException;%0D%0Aimport java.io.StringReader;%0D%0A%0D%0Apublic class DebugListener implements SoapInvokeListener %7B%0D%0A%09%0D%0A%09private static final Logger log = LoggerFactory.getLogger(DebugListener.class);%0D%0A%09%0D%0A%09private List%3CString%3E ignoreList = new ArrayList();%0D%0A%09%0D%0A%09public void addIgnoreOperation(String op) %7B this.ignoreList.add(op);%7D%0D%0A%09public void removeIgnoreOperation(String op) %7B this.ignoreList.remove(op);%7D%0D%0A%09%0D%0A%09public List%3CString%3E getIgnoreOperations() %7B return this.ignoreList;%7D%0D%0A%09%0D%0A%09public void beforeInvoke(SoapInvokeEvent e) %7B%0D%0A%09%09String op = e.getOperation();%0D%0A%09%09if (this.ignoreList.contains(op)) %7B%0D%0A%09%09%09return;%0D%0A%09%09%7D%0D%0A%09%09String msg = indent(e.getRequest());%0D%0A%09%09log.info(%22SoapRequest:%22 + op + %22%5Ctrequest:%22 + msg);%0D%0A%09%7D%0D%0A%09%0D%0A%09public void afterInvoke(SoapInvokeEvent e) %7B%0D%0A%09%09String op = e.getOperation();%0D%0A%09%09if (this.ignoreList.contains(op)) %7B%0D%0A%09%09%09return;%0D%0A%09%09%7D%0D%0A%09%09Exception ex = e.getException();%0D%0A%09%09if (ex != null) %7B%0D%0A%09%09%09if (ex instanceof SoapFaultException) %7B%0D%0A%09%09%09%09SoapFaultException fault = (SoapFaultException)ex;%0D%0A%09%09%09%09String msg = indent(fault.getSoapResponse().getAsString());%0D%0A%09%09%09%09log.error(%22SoapFault:%22 + op + %22%5Ctresponse:%22 + msg);%0D%0A%09%09%09%7D else %7B%0D%0A%09%09%09%09log.error(%22SoapError:%22 + ex.toString());%0D%0A%09%09%09%7D%0D%0A%09%09%09log.error(ex.getMessage(), ex);%0D%0A%09%09%7D else %7B%0D%0A%09%09%09String msg = indent(e.getResponse().getAsString());%0D%0A%09%09%09log.info(%22SoapResponse:%22 + op + %22%5Ctresponse:%22 + msg);%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09private String indent(String xml) %7B%0D%0A%09%09try %7B%0D%0A%09%09%09Document doc = XMLUtils.parse(new StringReader(xml));%0D%0A%09%09%09return XMLUtils.getAsString(doc, true);%0D%0A%09%09%7D catch (IOException e) %7B%0D%0A%09%09%09throw new IllegalStateException(e);%0D%0A%09%09%7D catch (SAXException e) %7B%0D%0A%09%09%09throw new IllegalStateException(e);%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%7D%0D%0A

Add DebugListener