1 7 8 package org.jboss.net.axis.server; 9 10 import org.jboss.axis.AxisFault; 11 import org.jboss.axis.ConfigurationException; 12 import org.jboss.axis.MessageContext; 13 import org.jboss.axis.server.AxisServer; 14 import org.jboss.axis.transport.http.AxisServlet; 15 import org.jboss.axis.transport.http.HTTPConstants; 16 17 import javax.servlet.http.HttpServletRequest ; 18 import javax.servlet.http.HttpServletResponse ; 19 import java.io.PrintWriter ; 20 21 35 36 public class AxisServiceServlet extends AxisServlet 37 { 38 39 40 protected AxisServer server = null; 41 42 43 public AxisServiceServlet() 44 { 45 } 46 47 51 public org.jboss.axis.server.AxisServer getEngine() throws AxisFault 52 { 53 if (server == null) 54 { 55 String installation = 58 getConfigurationContext(); 59 try 61 { 62 server = 63 JMXEngineConfigurationFactory 64 .newJMXFactory(installation) 65 .getAxisServer(); 66 } 67 catch (NullPointerException e) 68 { 69 throw new AxisFault("Could not access JMX configuration factory.", 70 e); 71 } 72 } 73 74 return server; 75 } 76 77 78 protected String getConfigurationContext() 79 { 80 return getInitParameter(org.jboss.net.axis.Constants.CONFIGURATION_CONTEXT); 81 } 82 83 89 protected void reportAvailableServices(HttpServletResponse arg0, 90 PrintWriter arg1, 91 HttpServletRequest arg2) 92 throws ConfigurationException, AxisFault 93 { 94 MessageContext fake = new MessageContext(getEngine()); 95 AxisServer.setCurrentMessageContext(fake); 96 super.reportAvailableServices(arg0, arg1, arg2); 97 } 98 99 104 115 120 130 131 protected void fakeSoapAction(MessageContext arg0) 132 { 133 String pathInfo = (String )arg0.getProperty(HTTPConstants.MC_HTTP_SERVLETPATHINFO); 134 if (pathInfo == null) 135 { 136 pathInfo = ""; 137 } 138 else if (pathInfo.startsWith("/")) 139 { 140 pathInfo = pathInfo.substring(1); 141 } 142 arg0.setSOAPActionURI(pathInfo); 143 } 144 145 } | Popular Tags |