You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2006/06/02 16:02:20 UTC
svn commit: r411162 - in /webservices/axis2/trunk/java/modules:
codegen/test/org/apache/axis2/wsdl/ core/src/org/apache/axis2/
core/src/org/apache/axis2/context/ core/src/org/apache/axis2/description/
core/src/org/apache/axis2/engine/ core/src/org/apac...
Author: deepal
Date: Fri Jun 2 07:02:19 2006
New Revision: 411162
URL: http://svn.apache.org/viewvc?rev=411162&view=rev
Log:
- fix security test failures
- make to change the axis2 configuration path
- no hard code path checking for services
- you can change the context path by just adding parameter in axis2.xml
- if you rename the war it will correctly generate wsdl
(there were few bugs)
Modified:
webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/wsdl/WSDLServiceBuilderTest.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SimpleHTTPServer.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/SimpleMailListener.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/util/UtilsParseRequestTest.java
webservices/axis2/trunk/java/modules/integration/maven.xml
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceCreateTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/ConversationScenario1Test.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/ConversationScenario4Test.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/TestClient.java
webservices/axis2/trunk/java/modules/webapp/HappyAxis.jsp
webservices/axis2/trunk/java/modules/webapp/listFaultyService.jsp
webservices/axis2/trunk/java/modules/webapp/listGroupService.jsp
webservices/axis2/trunk/java/modules/webapp/listService.jsp
webservices/axis2/trunk/java/modules/webapp/listServices.jsp
webservices/axis2/trunk/java/modules/webapp/listSingleService.jsp
Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/wsdl/WSDLServiceBuilderTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/wsdl/WSDLServiceBuilderTest.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/wsdl/WSDLServiceBuilderTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/wsdl/WSDLServiceBuilderTest.java Fri Jun 2 07:02:19 2006
@@ -67,7 +67,7 @@
System.out.println("Testinf file: " + file1.getName());
configContext.getAxisConfiguration().addService(service);
OutputStream out = new FileOutputStream(new File(outLocation, file1.getName()));
- service.printWSDL(out, "http://google.com/axis2/services");
+ service.printWSDL(out, "http://google.com/axis2/services" ,"services");
out.flush();
out.close();
// URL wsdlURL = new URL("http://localhost:" + 6060 +
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java Fri Jun 2 07:02:19 2006
@@ -68,6 +68,15 @@
public static final String MESSAGE_SCOPE = "message";
/**
+ * To chenge the conetext path from axis2/service to something else
+ */
+ public static final String CONTEXT_PATH = "contextPath";
+ /**
+ * To chenage the service path to somthing else
+ */
+ public static final String SERVICE_PATH = "SERVICE_PATH";
+
+ /**
* Field APPLICATION_SCOPE
*/
public static final String SCOPE_APPLICATION = "application";
@@ -98,10 +107,6 @@
/**
* Field REQUEST_URL_PREFIX
*/
- public static final String REQUEST_URL_PREFIX = "/services";
- public static final String LOGOUT = "logout";
- public static final String LIST_SERVICE_FOR_MODULE_ENGAGEMENT = "listoperation";
- public static final String LIST_SERVICES = "listServices";
public static final String LIST_PHASES = "listPhases";
public static final String LIST_MODULES = "listModules";
public static final String LIST_GLOABLLY_ENGAGED_MODULES = "globalModules";
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java Fri Jun 2 07:02:19 2006
@@ -40,7 +40,7 @@
*/
public class ConfigurationContext extends AbstractContext {
- private static final Log log = LogFactory.getLog(ConfigurationContext.class);
+ private static final Log log = LogFactory.getLog(ConfigurationContext.class);
/**
* Map containing <code>MessageID</code> to
* <code>OperationContext</code> mapping.
@@ -57,6 +57,11 @@
// current time out interval is 30 secs. Need to make this configurable
private long serviceGroupContextTimoutInterval = 30 * 1000;
+ //To specify url mapping for services
+ private String servicePath = "services";
+ //To have your own context path
+ private String contextPath = "/axis2";
+
public ConfigurationContext(AxisConfiguration axisConfiguration) {
super(null);
this.axisConfiguration = axisConfiguration;
@@ -361,5 +366,21 @@
cleanupServiceContextes(serviceGroupContext);
}
}
+ }
+
+ public String getServicePath() {
+ return servicePath;
+ }
+
+ public void setServicePath(String servicePath) {
+ this.servicePath = servicePath;
+ }
+
+ public String getContextPath() {
+ return contextPath + "/" + servicePath;
+ }
+
+ public void setContextPath(String contextPath) {
+ this.contextPath = contextPath;
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java Fri Jun 2 07:02:19 2006
@@ -1,18 +1,20 @@
package org.apache.axis2.context;
import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
import org.apache.axis2.deployment.DeploymentException;
import org.apache.axis2.deployment.FileSystemConfigurator;
import org.apache.axis2.deployment.URLBasedAxisConfigurator;
import org.apache.axis2.description.AxisModule;
+import org.apache.axis2.description.Parameter;
import org.apache.axis2.description.TransportOutDescription;
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.engine.AxisConfigurator;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.modules.Module;
import org.apache.axis2.transport.TransportSender;
-import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import java.net.URL;
import java.util.Collection;
@@ -37,12 +39,32 @@
AxisConfigurator axisConfigurator) throws AxisFault {
AxisConfiguration axisConfig = axisConfigurator.getAxisConfiguration();
ConfigurationContext configContext = new ConfigurationContext(axisConfig);
+ //To override context path
+ setContextPath(axisConfig, configContext);
init(configContext);
axisConfigurator.engageGlobalModules();
axisConfigurator.loadServices();
return configContext;
}
+ private static void setContextPath(AxisConfiguration axisConfig, ConfigurationContext configContext) {
+ // Checking for context path
+ Parameter servicePath = axisConfig.getParameter(Constants.SERVICE_PATH);
+ if (servicePath != null) {
+ String spath = ((String) servicePath.getValue()).trim();
+ if (spath.length() > 0) {
+ configContext.setServicePath(spath);
+ }
+ }
+ Parameter contextPath = axisConfig.getParameter(Constants.CONTEXT_PATH);
+ if (contextPath != null) {
+ String cpath = ((String) contextPath.getValue()).trim();
+ if (cpath.length() > 0) {
+ configContext.setContextPath(cpath);
+ }
+ }
+ }
+
/**
* To get a ConfigurationContext for given data , and underline implementation
* is Axis2 default impl which is file system based deployment model to create
@@ -80,7 +102,7 @@
*
* @param path : location of the repository
* @param axis2xml : location of the axis2.xml (configuration) , you can not give
- * axis2xml relative to repository.
+ * axis2xml relative to repository.
* @return Returns the built ConfigurationContext.
* @throws DeploymentException
*/
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java Fri Jun 2 07:02:19 2006
@@ -506,7 +506,7 @@
return null;
}
- public void printWSDL(OutputStream out, String requestIP) throws AxisFault {
+ public void printWSDL(OutputStream out, String requestIP, String servicePath) throws AxisFault {
ArrayList eprList = new ArrayList();
AxisConfiguration axisConfig = getAxisConfiguration();
if (enableAllTransport) {
@@ -553,7 +553,7 @@
}
}
String eprArray [] = (String[]) eprList.toArray(new String[eprList.size()]);
- getWSDL(out, eprArray);
+ getWSDL(out, eprArray, servicePath);
}
/**
@@ -565,13 +565,13 @@
public void printWSDL(OutputStream out) throws AxisFault {
setWsdlfound(true);
//pick the endpoint and take it as the epr for the WSDL
- getWSDL(out, new String[]{getEndpoint()});
+ getWSDL(out, new String[]{getEndpoint()}, "services");
}
- private void getWSDL(OutputStream out, String [] serviceURL) throws AxisFault {
+ private void getWSDL(OutputStream out, String [] serviceURL, String servicePath) throws AxisFault {
if (isWsdlfound()) {
AxisService2OM axisService2WOM = new AxisService2OM(this,
- serviceURL, "document", "literal");
+ serviceURL, "document", "literal", servicePath);
try {
OMElement wsdlElement = axisService2WOM.generateOM();
wsdlElement.serialize(out);
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java Fri Jun 2 07:02:19 2006
@@ -70,11 +70,12 @@
private String style;
private String use;
+ private String servicePath ;
private boolean generateHttp = false;
public AxisService2OM(AxisService service, String[] serviceURL,
- String style, String use) {
+ String style, String use , String servicePath) {
this.axisService = service;
url = serviceURL;
if (style == null) {
@@ -87,6 +88,7 @@
} else {
this.use = use;
}
+ this.servicePath = servicePath;
this.targetNamespace = service.getTargetNamespace();
}
@@ -399,7 +401,7 @@
+ axisService.getName() + HTTP_BINDING, null);
OMElement extElement = fac.createOMElement("address", http);
port.addChild(extElement);
- urlString = urlString.replaceAll("services", "rest");
+ urlString = urlString.replaceAll(servicePath, "rest");
extElement.addAttribute("location", urlString, null);
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java Fri Jun 2 07:02:19 2006
@@ -77,7 +77,8 @@
}
QName serviceName;
- String[] values = Utils.parseRequestURLForServiceAndOperation(address);
+ String[] values = Utils.parseRequestURLForServiceAndOperation(address ,
+ messageContext.getConfigurationContext().getServicePath());
if (values == null) {
return null;
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java Fri Jun 2 07:02:19 2006
@@ -51,7 +51,8 @@
EndpointReference toEPR = messageContext.getTo();
if ((toEPR != null) && (operationName == null)) {
String filePart = toEPR.getAddress();
- String[] values = Utils.parseRequestURLForServiceAndOperation(filePart);
+ String[] values = Utils.parseRequestURLForServiceAndOperation(filePart ,
+ messageContext.getConfigurationContext().getServicePath());
if ((values.length >= 2) && (values[1] != null)) {
operationName = new QName(values[1]);
@@ -78,7 +79,8 @@
log.debug("Checking for Service using target endpoint address : " + toEPR.getAddress());
String filePart = toEPR.getAddress();
- String[] values = Utils.parseRequestURLForServiceAndOperation(filePart);
+ String[] values = Utils.parseRequestURLForServiceAndOperation(filePart ,
+ messageContext.getConfigurationContext().getServicePath());
if (values[1] != null) {
operationName = new QName(values[1]);
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java Fri Jun 2 07:02:19 2006
@@ -80,7 +80,8 @@
"Checking for Service using SOAP message body's first child's namespace : "
+ filePart);
- String[] values = Utils.parseRequestURLForServiceAndOperation(filePart);
+ String[] values = Utils.parseRequestURLForServiceAndOperation(filePart ,
+ messageContext.getConfigurationContext().getServicePath());
if (values[1] != null) {
operationName = new QName(values[1]);
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java Fri Jun 2 07:02:19 2006
@@ -52,7 +52,7 @@
*/
public class AxisServlet extends HttpServlet implements TransportListener {
- private static final Log log = LogFactory.getLog(AxisServlet.class);
+ private static final Log log = LogFactory.getLog(AxisServlet.class);
private static final long serialVersionUID = -2085869393709833372L;
public static final String CONFIGURATION_CONTEXT = "CONFIGURATION_CONTEXT";
public static final String SESSION_ID = "SessionId";
@@ -62,6 +62,8 @@
protected transient ServletConfig servletConfig;
private transient ListingAgent agent;
+ public static String SERVICE_PATH;
+ private String conetxtPath;
protected MessageContext createAndSetInitialParamsToMsgCtxt(MessageContext msgContext, HttpServletResponse httpServletResponse,
@@ -204,6 +206,7 @@
listenerManager.addListener(transportInDescription, true);
ListenerManager.defaultConfigurationContext = configContext;
agent = new ListingAgent(configContext);
+ SERVICE_PATH = configContext.getServicePath();
} catch (Exception e) {
throw new ServletException(e);
}
@@ -287,17 +290,20 @@
if (port == null) {
port = "8080";
}
- String webappName = null;
- // HACK ALERT!!! - Is there a better way to get the webapp name?
- try{
- String[] array = servletConfig.getServletContext().getResource("/").toString().split("/");
- webappName = array[array.length-1];
- }catch(Exception e){
- }
- if(webappName == null) {
- webappName = "axis2";
+ if (conetxtPath == null) {
+ // HACK ALERT!!! - Is there a better way to get the webapp name?
+ try {
+ String[] array = servletConfig.getServletContext().getResource("/").toString().split("/");
+ conetxtPath = array[array.length - 1];
+ configContext.setContextPath(conetxtPath);
+ } catch (Exception e) {
+ }
+ if (conetxtPath == null) {
+ conetxtPath = "axis2";
+ }
}
- return new EndpointReference("http://" + ip + ":" + port + '/' + webappName + "/services/" + serviceName);
+ return new EndpointReference("http://" + ip + ":" + port + '/' +
+ conetxtPath + "/" + SERVICE_PATH + "/" + serviceName);
}
protected MessageContext createMessageContext(HttpServletRequest req,
@@ -321,7 +327,7 @@
msgContext.setServerSide(true);
String requestURI = req.getRequestURI();
- requestURI = requestURI.replaceFirst("rest", "services");
+ requestURI = requestURI.replaceFirst("rest", SERVICE_PATH);
msgContext.setTo(new EndpointReference(requestURI));
msgContext.setProperty(Constants.OUT_TRANSPORT_INFO,
new ServletBasedOutTransportInfo(resp));
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java Fri Jun 2 07:02:19 2006
@@ -46,7 +46,6 @@
public class CommonsHTTPTransportSender extends AbstractHandler implements TransportSender {
- private static final long serialVersionUID = 7929963795196215199L;
protected static final String PROXY_HOST_NAME = "proxy_host";
protected static final String PROXY_PORT = "proxy_port";
int soTimeout = HTTPConstants.DEFAULT_SO_TIMEOUT;
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java Fri Jun 2 07:02:19 2006
@@ -20,9 +20,9 @@
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMException;
import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.util.StAXUtils;
import org.apache.axiom.om.impl.builder.StAXBuilder;
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.util.StAXUtils;
import org.apache.axiom.soap.*;
import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
import org.apache.axiom.soap.impl.llom.soap11.SOAP11Factory;
@@ -39,7 +39,6 @@
import org.apache.axis2.util.Utils;
import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import java.io.IOException;
@@ -54,7 +53,8 @@
public static SOAPEnvelope createEnvelopeFromGetRequest(String requestUrl, Map map,
ConfigurationContext configurationContext) throws AxisFault {
- String[] values = Utils.parseRequestURLForServiceAndOperation(requestUrl);
+ String[] values = Utils.parseRequestURLForServiceAndOperation(requestUrl,
+ configurationContext.getServicePath());
if (values == null) {
return new SOAP11Factory().getDefaultEnvelope();
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java Fri Jun 2 07:02:19 2006
@@ -48,13 +48,17 @@
public class HTTPWorker implements HttpRequestHandler {
- private static final Log log = LogFactory.getLog(HTTPWorker.class);
+ private static final Log log = LogFactory.getLog(HTTPWorker.class);
private ConfigurationContext configurationContext;
// to store session object
private Hashtable sessionContextTable = new Hashtable();
+ private String contextPath = null;
+ private String servicePath = null;
public HTTPWorker(ConfigurationContext configurationContext) {
this.configurationContext = configurationContext;
+ contextPath = configurationContext.getContextPath();
+ servicePath = configurationContext.getServicePath();
}
public boolean processRequest(final SimpleHttpServerConnection conn,
@@ -131,16 +135,16 @@
conn.writeResponse(response);
return true;
}
- if (!uri.startsWith("/axis2/services/")) {
+ if (!uri.startsWith(contextPath)) {
response.setStatusLine(request.getRequestLine().getHttpVersion(), 301, "Redirect");
- response.addHeader(new Header("Location", "/axis2/services/"));
+ response.addHeader(new Header("Location", contextPath));
conn.writeResponse(response);
return true;
}
if (uri.indexOf("?") < 0) {
- if (!(uri.endsWith("/axis2/services/") || uri.endsWith("/axis2/services"))) {
- String serviceName = uri.replaceAll("/axis2/services/", "");
+ if (!(uri.endsWith(contextPath))) {
+ String serviceName = uri.replaceAll(contextPath, "");
if (serviceName.indexOf("/") < 0) {
response.addHeader(new Header("Content-Type", "text/html"));
String res = HTTPTransportReceiver.printServiceHTML(serviceName, configurationContext);
@@ -169,7 +173,7 @@
ip = ip.substring(0, seperatorIndex);
}
}
- service.printWSDL(baos, ip);
+ service.printWSDL(baos, ip,servicePath);
byte[] buf = baos.toByteArray();
response.setBody(new ByteArrayInputStream(buf));
conn.writeResponse(response);
@@ -191,7 +195,7 @@
}
//cater for named xsds - check for the xsd name
- if (uri.indexOf("?xsd=")>0) {
+ if (uri.indexOf("?xsd=") > 0) {
String serviceName = uri.substring(uri.lastIndexOf("/") + 1, uri.lastIndexOf("?xsd="));
String schemaName = uri.substring(uri.lastIndexOf("=") + 1);
@@ -202,23 +206,23 @@
service.populateSchemaMappings();
//write out the correct schema
Hashtable schemaTable = service.getSchemaMappingTable();
- XmlSchema schema = (XmlSchema)schemaTable.get(schemaName);
+ XmlSchema schema = (XmlSchema) schemaTable.get(schemaName);
//schema found - write it to the stream
- if (schema!=null){
+ if (schema != null) {
response.addHeader(new Header("Content-Type", "text/xml"));
schema.write(baos);
byte[] buf = baos.toByteArray();
response.setBody(new ByteArrayInputStream(buf));
conn.writeResponse(response);
- }else{
- // no schema available by that name - send 404
- response.setStatusLine(
- request.getRequestLine().getHttpVersion(),
- 404, "Schema Not Found!");
+ } else {
+ // no schema available by that name - send 404
+ response.setStatusLine(
+ request.getRequestLine().getHttpVersion(),
+ 404, "Schema Not Found!");
}
- return true;
+ return true;
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java Fri Jun 2 07:02:19 2006
@@ -45,9 +45,11 @@
private static final String LIST_FAULTY_SERVICES_JSP_NAME = "listFaultyService.jsp";
public static final String RUNNING_PORT = "RUNNING_PORT";
+ private String servicePath;
public ListingAgent(ConfigurationContext aConfigContext) {
super(aConfigContext);
+ servicePath = aConfigContext.getServicePath();
}
private void addTransportListner(String schema, int port) {
@@ -71,7 +73,7 @@
// httpServletRequest.getLocalPort() , giving me a build error so I had to use the followin
String filePart = httpServletRequest.getRequestURL().toString();
int ipindex = filePart.indexOf("//");
- String ip = null;
+ String ip;
if (ipindex >= 0) {
ip = filePart.substring(ipindex + 2, filePart.length());
int seperatorIndex = ip.indexOf(":");
@@ -93,15 +95,14 @@
}
protected void processListFaultyServices(HttpServletRequest req, HttpServletResponse res)
- throws IOException, ServletException {
- String serviceName = req.getParameter("serviceName");
- if (serviceName != null) {
- AxisService service = configContext.getAxisConfiguration().getService(serviceName);
- req.getSession().setAttribute(Constants.SINGLE_SERVICE, service);
- }
- renderView(LIST_FAULTY_SERVICES_JSP_NAME, req, res);
+ throws IOException, ServletException {
+ String serviceName = req.getParameter("serviceName");
+ if (serviceName != null) {
+ AxisService service = configContext.getAxisConfiguration().getService(serviceName);
+ req.getSession().setAttribute(Constants.SINGLE_SERVICE, service);
}
-
+ renderView(LIST_FAULTY_SERVICES_JSP_NAME, req, res);
+ }
protected void processIndex(HttpServletRequest httpServletRequest,
@@ -141,7 +142,7 @@
ip = ip.substring(0, seperatorIndex);
}
}
- ((AxisService) serviceObj).printWSDL(out, ip);
+ ((AxisService) serviceObj).printWSDL(out, ip, servicePath);
out.flush();
out.close();
return;
@@ -217,6 +218,7 @@
private int port;
private String schema;
+ private String conetxtPath;
public HTTPSTListener(int port, String schema) {
this.port = port;
@@ -225,6 +227,7 @@
public void init(ConfigurationContext axisConf,
TransportInDescription transprtIn) throws AxisFault {
+ conetxtPath = axisConf.getContextPath();
}
public void start() throws AxisFault {
@@ -234,7 +237,7 @@
}
public EndpointReference getEPRForService(String serviceName, String ip) throws AxisFault {
- return new EndpointReference(schema + "://" + ip + ":" + port + "/axis2/services/" + serviceName);
+ return new EndpointReference(schema + "://" + ip + ":" + port + conetxtPath +"/" +serviceName);
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SimpleHTTPServer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SimpleHTTPServer.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SimpleHTTPServer.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SimpleHTTPServer.java Fri Jun 2 07:02:19 2006
@@ -52,7 +52,7 @@
/**
* Field log
*/
- private static final Log log = LogFactory.getLog(SimpleHTTPServer.class);
+ private static final Log log = LogFactory.getLog(SimpleHTTPServer.class);
/**
* Embedded commons http client based server
@@ -63,6 +63,7 @@
public static int DEFAULT_PORT = 8080;
private String hostAddress = null;
+ private String conetxtPath;
/**
* Field systemContext
@@ -105,6 +106,7 @@
listenerManager.init(configurationContext);
}
listenerManager.addListener(trsIn, true);
+ conetxtPath = configurationContext.getContextPath();
}
/**
@@ -128,6 +130,7 @@
if (param != null) {
hostAddress = ((String) param.getValue()).trim();
}
+ conetxtPath = configurationContext.getContextPath();
} catch (Exception e1) {
throw new AxisFault(e1);
}
@@ -230,7 +233,7 @@
//if host address is present
if (hostAddress != null) {
if (embedded != null) {
- return new EndpointReference(hostAddress + "/axis2/services/" + serviceName);
+ return new EndpointReference(hostAddress + conetxtPath + serviceName);
} else {
throw new AxisFault("Unable to generate EPR for the transport : http");
}
@@ -249,7 +252,7 @@
if (embedded != null) {
return new EndpointReference("http://" + localAddress + ":" +
(embedded.getLocalPort())
- + "/axis2/services/" + serviceName);
+ + conetxtPath + "/" + serviceName);
} else {
throw new AxisFault("Unable to generate EPR for the transport : http");
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/SimpleMailListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/SimpleMailListener.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/SimpleMailListener.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/SimpleMailListener.java Fri Jun 2 07:02:19 2006
@@ -50,7 +50,7 @@
*
*/
public class SimpleMailListener implements Runnable, TransportListener {
- private static final Log log = LogFactory.getLog(SimpleMailListener.class);
+ private static final Log log = LogFactory.getLog(SimpleMailListener.class);
// Are we doing threads?
private static boolean doThreads = true;
@@ -64,6 +64,7 @@
private String port;
private String replyTo;
private String user;
+ private String servicePath;
public SimpleMailListener() {
}
@@ -102,6 +103,7 @@
listenerManager.init(configurationContext);
}
listenerManager.addListener(trsIn, true);
+ servicePath = configurationContext.getServicePath();
}
/*
@@ -116,7 +118,7 @@
password = Utils.getParameterValue(transportIn.getParameter(MailSrvConstants.POP3_PASSWORD));
port = Utils.getParameterValue(transportIn.getParameter(MailSrvConstants.POP3_PORT));
replyTo = Utils.getParameterValue(transportIn.getParameter(MailSrvConstants.RAPLY_TO));
-
+ servicePath = configurationContext.getServicePath();
if ((user == null) || (host == null) || (password == null) || (port == null)) {
if (this.user == null) {
throw new AxisFault(Messages.getMessage("canNotBeNull", "User"));
@@ -129,10 +131,8 @@
if (this.port == null) {
throw new AxisFault(Messages.getMessage("canNotBeNull", "Port"));
}
+ throw new AxisFault(Messages.getMessage("canNotBeNull", "Password"));
- if (this.password == null) {
- throw new AxisFault(Messages.getMessage("canNotBeNull", "Password"));
- }
}
}
@@ -197,11 +197,10 @@
MimeMessage msg = (MimeMessage) msgs[i];
if (msg != null) {
MailWorker worker = new MailWorker(msg, configurationContext);
-
worker.run();
+ msg.setFlag(Flags.Flag.DELETED, true);
}
- msg.setFlag(Flags.Flag.DELETED, true);
}
}
@@ -282,7 +281,7 @@
* @see org.apache.axis2.transport.TransportListener#replyToEPR(java.lang.String)
*/
public EndpointReference getEPRForService(String serviceName, String ip) throws AxisFault {
- return new EndpointReference(replyTo + "/services/" + serviceName);
+ return new EndpointReference(replyTo + "/" + servicePath + "/" + serviceName);
}
public void setDoThreads(boolean value) {
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java Fri Jun 2 07:02:19 2006
@@ -27,7 +27,6 @@
import org.apache.axis2.engine.ListenerManager;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.transport.TransportListener;
-import org.apache.axis2.transport.http.SimpleHTTPServer;
import org.apache.axis2.transport.http.server.SimpleHttpServerConnection;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -45,10 +44,11 @@
public class TCPServer implements Runnable, TransportListener {
private int port = 8000;
private boolean started = false;
- private static final Log log = LogFactory.getLog(TCPServer.class);
+ private static final Log log = LogFactory.getLog(TCPServer.class);
private ConfigurationContext configContext;
private ServerSocket serversocket;
private String hostAddress = null;
+ private String conetxtPath;
public TCPServer() {
}
@@ -67,7 +67,7 @@
listenerManager.init(configContext);
}
listenerManager.addListener(trsIn, true);
-
+ conetxtPath = configContext.getContextPath();
} catch (IOException e1) {
throw new AxisFault(e1);
@@ -91,6 +91,7 @@
if (param != null) {
hostAddress = ((String) param.getValue()).trim();
}
+ conetxtPath = configContext.getContextPath();
}
public static void main(String[] args) throws AxisFault, NumberFormatException {
@@ -180,14 +181,14 @@
* created by taking the hostAddres into account
* (non-Javadoc)
*
- * @see org.apache.axis2.transport.TransportListener#replyToEPR(String)
+ * @see org.apache.axis2.transport.TransportListener#getEPRForService(String, String)
*/
public EndpointReference getEPRForService(String serviceName, String ip) throws AxisFault {
//if host address is present
if (hostAddress != null) {
if (serversocket != null) {
// todo this has to fix
- return new EndpointReference(hostAddress + "/axis2/services/" + serviceName);
+ return new EndpointReference(hostAddress + conetxtPath + serviceName);
} else {
log.debug("Unable to generate EPR for the transport tcp");
return null;
@@ -203,7 +204,7 @@
if (serversocket != null) {
// todo this has to fix
return new EndpointReference("tcp://" + ip + ":" + (serversocket.getLocalPort())
- + "/axis2/services/" + serviceName);
+ + conetxtPath + "/" + serviceName);
} else {
log.debug("Unable to generate EPR for the transport tcp");
return null;
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java Fri Jun 2 07:02:19 2006
@@ -175,18 +175,18 @@
* @return an array where element [0] always contains the service, and element 1, if not null, contains
* the path after the first element. all ? parameters are discarded.
*/
- public static String[] parseRequestURLForServiceAndOperation(String path) {
+ public static String[] parseRequestURLForServiceAndOperation(String path, String servicePath) {
if (path == null) {
return null;
}
String[] values = new String[2];
// TODO. This is kind of brittle. Any service with the name /services would cause fun.
- int index = path.lastIndexOf(Constants.REQUEST_URL_PREFIX);
+ int index = path.lastIndexOf(servicePath);
String service;
if (-1 != index) {
- int serviceStart = index + Constants.REQUEST_URL_PREFIX.length();
+ int serviceStart = index + servicePath.length();
if (path.length() > serviceStart + 1) {
service = path.substring(serviceStart + 1);
Modified: webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/util/UtilsParseRequestTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/util/UtilsParseRequestTest.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/util/UtilsParseRequestTest.java (original)
+++ webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/util/UtilsParseRequestTest.java Fri Jun 2 07:02:19 2006
@@ -70,7 +70,7 @@
}
private void assertParsesTo(String path, String service, String operation) {
- String[] strings = Utils.parseRequestURLForServiceAndOperation(path);
+ String[] strings = Utils.parseRequestURLForServiceAndOperation(path, "/axis2/services");
assertEquals(service,strings[0]);
assertEquals(operation, strings[1]);
}
Modified: webservices/axis2/trunk/java/modules/integration/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/maven.xml?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/maven.xml Fri Jun 2 07:02:19 2006
@@ -159,7 +159,7 @@
<copy overwrite="yes" file="test-resources/security/rahas/s1-services.xml"
tofile="target/temp-rahas/META-INF/services.xml"/>
- <jar jarfile="target/test-resources/rahas_service_repo_1/services/Service.aar"
+ <jar jarfile="target/test-resources/rahas_service_repo_1/services/SecureService.aar"
basedir="target/temp-rahas"/>
<!-- Rahas Test - 1 :END -->
@@ -180,7 +180,7 @@
<copy overwrite="yes" file="test-resources/security/rahas/s2-services.xml"
tofile="target/temp-rahas/META-INF/services.xml"/>
- <jar overwrite="yes" jarfile="target/test-resources/rahas_service_repo_2/services/Service.aar"
+ <jar overwrite="yes" jarfile="target/test-resources/rahas_service_repo_2/services/SecureService.aar"
basedir="target/temp-rahas"/>
<!-- Rahas Test - 2 :END -->
@@ -201,7 +201,7 @@
<copy overwrite="yes" file="test-resources/security/rahas/s3-services.xml"
tofile="target/temp-rahas/META-INF/services.xml"/>
- <jar overwrite="yes" jarfile="target/test-resources/rahas_service_repo_3/services/Service.aar"
+ <jar overwrite="yes" jarfile="target/test-resources/rahas_service_repo_3/services/SecureService.aar"
basedir="target/temp-rahas"/>
<!-- Rahas Test - 3 :END -->
@@ -222,7 +222,7 @@
<copy overwrite="yes" file="test-resources/security/rahas/s4-services.xml"
tofile="target/temp-rahas/META-INF/services.xml"/>
- <jar overwrite="yes" jarfile="target/test-resources/rahas_service_repo_4/services/Service.aar"
+ <jar overwrite="yes" jarfile="target/test-resources/rahas_service_repo_4/services/SecureService.aar"
basedir="target/temp-rahas"/>
<!-- Rahas Test - 4 :END -->
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceCreateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceCreateTest.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceCreateTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceCreateTest.java Fri Jun 2 07:02:19 2006
@@ -66,7 +66,7 @@
assertNotNull(messge.getSchemaElement());
assertNotNull(service.getOperation(new QName("putValue")));
assertNotNull(axisConfig.getService("MyService"));
- service.printWSDL(System.out, null);
+ service.printWSDL(System.out, null,"services");
RPCServiceClient client = new RPCServiceClient(clinetConfigurationctx, null);
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/ConversationScenario1Test.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/ConversationScenario1Test.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/ConversationScenario1Test.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/ConversationScenario1Test.java Fri Jun 2 07:02:19 2006
@@ -39,7 +39,7 @@
config.setCryptoPropertiesFile("sec.properties");
config.setScope(ConversationConfiguration.SCOPE_SERVICE);
config.setPasswordCallbackClass(PWCallback.class.getName());
- config.setStsEPRAddress("http://localhost:" + port + "/axis2/services/Service");
+ config.setStsEPRAddress("http://localhost:" + port + "/axis2/services/SecureService");
return config.getParameter();
}
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/ConversationScenario4Test.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/ConversationScenario4Test.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/ConversationScenario4Test.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/ConversationScenario4Test.java Fri Jun 2 07:02:19 2006
@@ -37,7 +37,7 @@
config.setScope(ConversationConfiguration.SCOPE_SERVICE);
config.setPasswordCallbackClass(PWCallback.class.getName());
config.setProvideEntropy(true);
- config.setStsEPRAddress("http://localhost:" + port + "/axis2/services/Service");
+ config.setStsEPRAddress("http://localhost:" + port + "/axis2/services/SecureService");
return config.getParameter();
}
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/TestClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/TestClient.java?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/TestClient.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/rahas/TestClient.java Fri Jun 2 07:02:19 2006
@@ -72,10 +72,10 @@
null);
ServiceClient serviceClient = new ServiceClient(configContext, null);
Options options = new Options();
- options.setTo(new EndpointReference("http://127.0.0.1:" + port + "/axis2/services/Service"));
+ options.setTo(new EndpointReference("http://127.0.0.1:" + port + "/axis2/services/SecureService"));
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
+
OutflowConfiguration clientOutflowConfiguration = getClientOutflowConfiguration();
if(clientOutflowConfiguration != null) {
options.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY, clientOutflowConfiguration.getProperty());
@@ -85,25 +85,25 @@
options.setProperty(WSSHandlerConstants.INFLOW_SECURITY, clientInflowConfiguration.getProperty());
}
options.setProperty(ConversationConfiguration.RAHAS_CONFIG, getClientConversationConfiguration());
-
+
options.setAction("urn:echo");
-
+
serviceClient.engageModule(rahasModule);
serviceClient.setOptions(options);
-
+
//Blocking invocation
serviceClient.sendReceive(payload);
-
+
serviceClient.sendReceive(getEchoElement());
-
+
OMElement result = serviceClient.sendReceive(getEchoElement());
-
+
StringWriter writer = new StringWriter();
result.serialize(StAXUtils
.createXMLStreamWriter(writer));
writer.flush();
-
+
assertTrue(writer.toString().indexOf(AXIS2_ECHO_STRING) > 0);
System.out.println("SecureService Invocation successful :-)");
} catch (AxisFault axisFault) {
Modified: webservices/axis2/trunk/java/modules/webapp/HappyAxis.jsp
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/webapp/HappyAxis.jsp?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/webapp/HappyAxis.jsp (original)
+++ webservices/axis2/trunk/java/modules/webapp/HappyAxis.jsp Fri Jun 2 07:02:19 2006
@@ -1,22 +1,25 @@
<html>
<%@ page import="org.apache.axiom.om.OMAbstractFactory,
- org.apache.axiom.om.OMElement,
- org.apache.axiom.om.OMNamespace,
- org.apache.axiom.om.OMFactory,
+ org.apache.axiom.om.OMElement,
+ org.apache.axiom.om.OMFactory,
+ org.apache.axiom.om.OMNamespace,
org.apache.axis2.AxisFault,
org.apache.axis2.Constants,
org.apache.axis2.addressing.EndpointReference,
org.apache.axis2.client.Options,
org.apache.axis2.client.ServiceClient,
+ org.apache.axis2.context.ConfigurationContext,
+ org.apache.axis2.context.ConfigurationContextFactory,
+ org.apache.axis2.transport.http.AxisServlet,
javax.servlet.ServletContext,
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse,
javax.servlet.jsp.JspWriter,
- javax.xml.parsers.SAXParser,
- javax.xml.parsers.SAXParserFactory,
- javax.xml.stream.XMLOutputFactory,
- javax.xml.stream.XMLStreamException"
+ javax.xml.parsers.SAXParser"
session="false" %>
+<%@ page import="javax.xml.parsers.SAXParserFactory" %>
+<%@ page import="javax.xml.stream.XMLOutputFactory" %>
+<%@ page import="javax.xml.stream.XMLStreamException" %>
<%@ page import="java.io.IOException" %>
<%@ page import="java.io.InputStream" %>
<%@ page import="java.io.StringWriter" %>
@@ -55,8 +58,8 @@
int lastindex = IP.lastIndexOf('/');
IP = IP.substring(0, lastindex);
///axis2/axis2-web/services/version
- IP= IP.replaceAll("axis2-web","");
- targetEPR = new EndpointReference(IP + "services/version");
+ IP = IP.replaceAll("axis2-web", "");
+ targetEPR = new EndpointReference(IP + AxisServlet.SERVICE_PATH + "/version");
%>
<%!
/*
@@ -345,7 +348,9 @@
public boolean inVokeTheService() {
try {
OMElement payload = createEnvelope();
- ServiceClient client = new ServiceClient();
+ ConfigurationContext configctx =
+ ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
+ ServiceClient client = new ServiceClient(configctx, null);
Options options = new Options();
client.setOptions(options);
options.setTo(targetEPR);
@@ -358,7 +363,7 @@
value = writer.toString();
return true;
} catch (AxisFault axisFault) {
- value = axisFault.getMessage();
+ System.out.println( value);
return false;
} catch (XMLStreamException e) {
value = e.getMessage();
@@ -381,7 +386,7 @@
* the essentials, without these Axis is not going to work
*/
needed = needClass(out, "org.apache.axis2.transport.http.AxisServlet",
- "axis2-0.93.jar",
+ "axis2-1.0.jar",
"Apache-Axis",
"Axis2 will not work",
"http://xml.apache.org/axis2/");
@@ -390,12 +395,6 @@
"Jakarta-Commons Logging",
"Axis2 will not work",
"http://jakarta.apache.org/commons/logging.html");
-
- needed += needClass(out, "org.apache.log4j.Layout",
- "log4j-1.2.8.jar",
- "Log4j",
- "Axis2 may not work",
- "http://jakarta.apache.org/log4j");
needed += needClass(out, "javax.xml.stream.XMLStreamReader",
"stax-api-1.0.jar",
"Streaming API for XML",
@@ -439,9 +438,11 @@
out.write("</h3>");
%>
<p>
- <B><I>Note:</I></B> Even if everything this page probes for is present, there is no guarantee
+ <B><I>Note:</I></B> Even if everything this page probes for is present,
+ there is no guarantee
your
- web axisService will work, because there are many configuration options that we do
+ web axisService will work, because there are many configuration options that
+ we do
not check for. These tests are <i>necessary</i> but not <i>sufficient</i>
<h2>Examining Version Service</h2>
@@ -451,7 +452,8 @@
%>
<p>
<font color="blue">
- Found the Axis2 default Version service and Axis2 is working properly.Now you can drop a service archive in axis2/WEB-INF/services.
+ Found the Axis2 default Version service and Axis2 is working
+ properly.Now you can drop a service archive in axis2/WEB-INF/services.
Following output was produced while invoking the version axisService:
<br>
@@ -462,8 +464,11 @@
} else {
%>
<p>
- <font color="brown"> There was a problem of examine Version service , may be the service not available or some thing has gone wrong. But this does not mean system does not working !
- Try to upload a some other service and check to see whether it is working.
+ <font color="brown"> There was a problem of examine Version service , may be
+ the service not available or some thing has gone wrong. But this does
+ not mean system does not working !
+ Try to upload a some other service and check to see whether it is
+ working.
<br>
</font>
</p>
@@ -474,7 +479,9 @@
<h2>Examining Application Server</h2>
<table>
<tr><td>Servlet version</td><td><%=getServletVersion()%></td></tr>
- <tr><td>Platform</td><td><%=getServletConfig().getServletContext().getServerInfo()%></td></tr>
+ <tr><td>Platform</td>
+ <td><%=getServletConfig().getServletContext().getServerInfo()%></td>
+ </tr>
</table>
<h2>Examining System Properties</h2>
Modified: webservices/axis2/trunk/java/modules/webapp/listFaultyService.jsp
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/webapp/listFaultyService.jsp?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/webapp/listFaultyService.jsp (original)
+++ webservices/axis2/trunk/java/modules/webapp/listFaultyService.jsp Fri Jun 2 07:02:19 2006
@@ -3,6 +3,7 @@
<%@ page import="org.apache.axis2.description.AxisService"%>
<%@ page import="java.util.Hashtable"%>
<%@ page import="java.util.Iterator"%>
+<%@ page import="org.apache.axis2.transport.http.AxisServlet"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
@@ -14,7 +15,7 @@
<jsp:include page="include/header.inc"></jsp:include>
<jsp:include page="include/link-footer.jsp"></jsp:include>
<%
- String prifix = request.getAttribute("frontendHostUrl") + "services/";
+ String prifix = request.getAttribute("frontendHostUrl") + AxisServlet.SERVICE_PATH +"services/";
String restprefix = request.getAttribute("frontendHostUrl") + "rest/";
%>
<%
Modified: webservices/axis2/trunk/java/modules/webapp/listGroupService.jsp
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/webapp/listGroupService.jsp?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/webapp/listGroupService.jsp (original)
+++ webservices/axis2/trunk/java/modules/webapp/listGroupService.jsp Fri Jun 2 07:02:19 2006
@@ -5,6 +5,7 @@
<%@ page import="java.util.Collection" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Iterator" %>
+<%@ page import="org.apache.axis2.transport.http.AxisServlet"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
@@ -18,7 +19,7 @@
</jsp:include>
<h1>Available services</h1>
<%
- String prifix = request.getAttribute("frontendHostUrl") + "services/";
+ String prifix = request.getAttribute("frontendHostUrl") + AxisServlet.SERVICE_PATH +"/";
%>
<%
HashMap serviceMap = (HashMap) request.getSession().getAttribute(Constants.SERVICE_MAP);
Modified: webservices/axis2/trunk/java/modules/webapp/listService.jsp
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/webapp/listService.jsp?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/webapp/listService.jsp (original)
+++ webservices/axis2/trunk/java/modules/webapp/listService.jsp Fri Jun 2 07:02:19 2006
@@ -7,6 +7,7 @@
<%@ page import="java.util.HashMap"%>
<%@ page import="java.util.Hashtable"%>
<%@ page import="java.util.Iterator"%>
+<%@ page import="org.apache.axis2.transport.http.AxisServlet"%>
<%
/*
* Copyright 2004,2005 The Apache Software Foundation.
@@ -36,7 +37,7 @@
<jsp:include page="include/adminheader.jsp" />
<h1>Available Services</h1>
- <% String prifix = request.getAttribute("frontendHostUrl") + "services/";
+ <% String prifix = request.getAttribute("frontendHostUrl") + AxisServlet.SERVICE_PATH + "/";
String restprefix = request.getAttribute("frontendHostUrl") + "rest/";
%>
<%
Modified: webservices/axis2/trunk/java/modules/webapp/listServices.jsp
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/webapp/listServices.jsp?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/webapp/listServices.jsp (original)
+++ webservices/axis2/trunk/java/modules/webapp/listServices.jsp Fri Jun 2 07:02:19 2006
@@ -6,6 +6,7 @@
<%@ page import="java.util.HashMap"%>
<%@ page import="java.util.Hashtable"%>
<%@ page import="java.util.Iterator"%>
+<%@ page import="org.apache.axis2.transport.http.AxisServlet"%>
<%--
/*
* Copyright 2002,2004 The Apache Software Foundation.
@@ -33,7 +34,7 @@
<jsp:include page="include/header.inc"></jsp:include>
<jsp:include page="include/link-footer.jsp"></jsp:include>
<h1>Available services</h1>
- <% String prifix = request.getAttribute("frontendHostUrl") + "services/";
+ <% String prifix = request.getAttribute("frontendHostUrl") + AxisServlet.SERVICE_PATH +"/";
String restprefix = request.getAttribute("frontendHostUrl") + "rest/";
%>
<%
Modified: webservices/axis2/trunk/java/modules/webapp/listSingleService.jsp
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/webapp/listSingleService.jsp?rev=411162&r1=411161&r2=411162&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/webapp/listSingleService.jsp (original)
+++ webservices/axis2/trunk/java/modules/webapp/listSingleService.jsp Fri Jun 2 07:02:19 2006
@@ -3,11 +3,12 @@
<%@ page import="org.apache.axis2.description.AxisService"%>
<%@ page import="java.util.Hashtable"%>
<%@ page import="java.util.Iterator"%>
+<%@ page import="org.apache.axis2.transport.http.AxisServlet"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:include page="include/adminheader.jsp"/>
<h1>List Single service</h1>
<%
- String prifix = request.getAttribute("frontendHostUrl") + "services/";
+ String prifix = request.getAttribute("frontendHostUrl") + AxisServlet.SERVICE_PATH +"/";
String restprefix = request.getAttribute("frontendHostUrl") + "rest/";
%>
<%
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org