1 29 30 package com.caucho.soa.servlet; 31 32 import com.caucho.soa.encoding.SoapEncoding; 33 34 import javax.servlet.GenericServlet ; 35 import javax.servlet.ServletException ; 36 import javax.servlet.ServletRequest ; 37 import javax.servlet.ServletResponse ; 38 import java.io.IOException ; 39 import java.util.logging.Logger ; 40 41 44 public class SoapProtocolServlet 45 extends GenericServlet 46 implements ProtocolServlet 47 { 48 protected static Logger log 49 = Logger.getLogger(SoapProtocolServlet.class.getName()); 50 51 private final SoapEncoding _soap = new SoapEncoding(); 52 53 56 public void setService(Object service) 57 { 58 _soap.setService(service); 59 } 60 61 public void init() 62 throws ServletException 63 { 64 try { 65 _soap.init(); 66 } catch (RuntimeException e) { 67 throw e; 68 } catch (Exception e) { 69 throw new ServletException (e); 70 } 71 } 72 73 public void service(ServletRequest request, ServletResponse response) 74 throws IOException , ServletException 75 { 76 try { 77 _soap.invoke(request.getInputStream(), 78 response.getOutputStream()); 79 } catch (IOException e) { 80 throw e; 81 } catch (ServletException e) { 82 throw e; 83 } catch (RuntimeException e) { 84 throw e; 85 } catch (Throwable e) { 86 throw new ServletException (e); 87 } 88 } 89 } 90 | Popular Tags |