1 23 package com.sun.enterprise.webservice; 24 25 import java.util.Iterator ; 26 27 import java.rmi.RemoteException ; 28 import java.rmi.UnmarshalException ; 29 30 import java.lang.reflect.Method ; 31 import javax.xml.namespace.QName ; 32 33 import javax.xml.rpc.JAXRPCException ; 34 import javax.xml.rpc.handler.Handler ; 35 import javax.xml.rpc.handler.GenericHandler ; 36 import javax.xml.rpc.handler.HandlerInfo ; 37 import javax.xml.rpc.handler.MessageContext ; 38 39 import com.sun.enterprise.Switch; 40 import com.sun.enterprise.ComponentInvocation; 41 import com.sun.enterprise.InvocationManager; 42 43 import java.util.logging.Logger ; 44 import java.util.logging.Level ; 45 import com.sun.logging.LogDomains; 46 47 53 public class ServletPreHandler extends GenericHandler { 54 55 private static Logger logger = 56 LogDomains.getLogger(LogDomains.WEB_LOGGER); 57 private WsUtil wsUtil = new WsUtil(); 58 59 public ServletPreHandler() {} 60 61 public QName [] getHeaders() { 62 return new QName [0]; 63 } 64 65 public boolean handleRequest(MessageContext context) { 66 ComponentInvocation inv = null; 67 68 try { 69 Switch theSwitch = Switch.getSwitch(); 70 InvocationManager invManager = theSwitch.getInvocationManager(); 71 inv = invManager.getCurrentInvocation(); 72 73 Method method = wsUtil.getInvMethod(inv.getWebServiceTie(), 74 context); 75 76 if( method != null ) { 79 inv.setWebServiceMethod(method); 80 } else { 81 inv.setWebServiceMethod(null); 82 } 83 84 } catch(Exception e) { 85 logger.log(Level.WARNING, "preWebHandlerError", e); 86 wsUtil.throwSOAPFaultException(e.getMessage(), context); 87 } 88 89 return true; 90 } 91 92 } 93 | Popular Tags |