Friday, October 14, 2011

MinuteProject goes SOA

Minuteproject "traditional" activity is to generate artifacts based on a Relation Database (RDBMS).
Meanwhile RDBMS is not the only type of standard structured information that is available on the market.
WSDL and WADL format describes a standard way to integrate systems with open technologies.
WSDL is widely used for webservice with SOAP messages integration promoted by the OASIS standards.
WADL is the representation of the REST contract offered by an application.

Minuteproject is integrating the metro API to parse wsdl and get a WsdlModel to generate artifacts upon.

The integration with metro is fairly simple

package metro;

import java.io.File;

import com.sun.tools.ws.processor.model.Model;
import com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler;
import com.sun.tools.ws.wscompile.ErrorReceiverFilter;
import com.sun.tools.ws.wscompile.WsimportOptions;

public class SimpleWSDLModel {

public static void main(String[] args) {
ErrorReceiverFilter receiver = new ErrorReceiverFilter();
WsimportOptions options = new WsimportOptions();
options.addWSDL(new File(args[0]));
WSDLModeler wsdlModeler = new WSDLModeler(options, receiver);
Model wsdlModel = wsdlModeler.buildModel();
System.out.println(wsdlModel);
}
}

When giving a wsdl location file-system or URL, then Metro provides a wsdlModel that contains all the wsdl structure in memory and xml schema elements converted into their jaxb correspondance.
This eases the integration into minuteproject since the elements (jaxb classes, service, port, binding) are ready to be set into templates.
The goal for minuteproject is not to re-do the JAX-WS part of Metro available by wsimport command but to add a set of new tracks and artifacts to reduce the development effort.

Some tracks could be:
  • SOA FitNesse track: providing a FitNesse wiki with fixture (slim) to test the webservice implementation (without deployment)
  • Screens: JSF, vaadin for webservice client
  • WebService implementation
  • ...
This functionality will be available in the next release 0.7.
The SOA tracks will be added one at time.