Original issue 153 created by soi-toolkit on 2011-06-17T07:03:03.000Z:
Sample explanation
Add support for the servlet transport
Generate web-projects for the IC
No good support for that right now...
Has to generate a new IC with the same name and manually copy the two web-projects + update the main-parent-pom.xml-file
Add jetty (embedded servlet container used for tests) to the service-projects pom-xml file
Add:
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<scope>test</scope>
<version>6.1.11</version>
</dependency>
Add the servlet-transport in common.xml - file
Add the line:
<servlet:connector name="servletConnector" />
Add a servlet-container to the MuleServer.java - file
Change import from:
import org.soitoolkit.commons.mule.test.StandaloneMuleServer;
to:
import org.soitoolkit.commons.mule.test.MuleServerWithServletContainer;
Add the following member variables:
public static final int HTTP_PORT = ${servletPort};
public static final String CONTEXT_PATH = "/${artifactId}";
public static final String MULE_SERVLET_URI = "/services";
Change how the Mule-server is started, i.e. add a servlet-container to it, change:
StandaloneMuleServer muleServer = new StandaloneMuleServer(MULE_SERVER_ID, MULE_CONFIG);
to:
MuleServerWithServletContainer muleServer = new MuleServerWithServletContainer(MULE_SERVER_ID, MULE_CONFIG, HTTP_PORT, CONTEXT_PATH, MULE_SERVLET_URI);
Change the implementation of the getAddress() - method, from:
String url = rb.getString(serviceUrlPropertyName);
logger.info("URL: {}", url);
return url;
to:
String url = rb.getString(serviceUrlPropertyName);
Original issue 153 created by soi-toolkit on 2011-06-17T07:03:03.000Z:
Sample explanation
Add support for the servlet transport
Add a servlet-container to the MuleServer.java - file
if (!url.startsWith("servlet://")) { logger.info("Non servlet URL: {}", url); return url; }
String uri = url.substring("servlet://".length()); url = "http://localhost:" + HTTP_PORT + CONTEXT_PATH + MULE_SERVLET_URI + "/" + uri; logger.info("Servlet URL: {}", url); return url;
// Initialize servlet engine in baseclass with proper values super(MULE_SERVER_ID, HTTP_PORT, CONTEXT_PATH, MULE_SERVLET_URI);
...example...