Moving
This blog is moving to http://chamerling.wordpress.com/ (articles have been migrated) but is still syndicated to eBM WebSourcing Blogs at http://blog.ebmwebsourcing.com/home/
This blog is moving to http://chamerling.wordpress.com/ (articles have been migrated) but is still syndicated to eBM WebSourcing Blogs at http://blog.ebmwebsourcing.com/home/
The current petals ESB snapshot comes with a new feature : A new command line interface.
This interface uses the petals ESB Web services which are now embedded within the container. There is no launcher for the CLI right now but it should come soon. For now, here are some snippets :
Connecting to http://localhost:7600/petals/ws ... PEtALS CLI. Tape 'help' for help. /> h PEtALS prompt usage: - a, addart Upload an artifact to the petals server - c, connect Connects the client to a petals server - e, endpoint Displays the list of endpoints - i, info Displays the container information - ic, install Deals with the component installation and uninstallation - j, jbiart Displays the list of JBI artefacts - q, stop Stops the container - r, repo Displays the petals repository content - t, topology Displays the petals topology - x, shutdown Shutdown the container />
/> t
Displays the petals topology
==============================
+ Container #1
- Name : NODE-EBM-00
- Address : node00.ebmwebsourcing.com
+ Container #2
- Name : NODE-OVH-00
- Address : node00.ovh.net
/> e
Displays the list of endpoints
================================
+ Endpoint #1
- Name : ProductWebServicePort
- Service : {http://productws. partner.soa4all.com/}ProductWebServiceService
- Interfaces : {http://productws. partner.soa4all.com/}ProductWebService,
- Location (component / container / domain) : petals-bc-soap / NODE-EBM-00 / subdomain1
+ Endpoint #2
- Name : IWebShopPort
- Service : {http://mamboofive.partner.soa4all.com/}IWebShopService
- Interfaces : {http://mamboofive. partner.soa4all.com/}IWebShop,
- Location (component / container / domain) : petals-bc-soap / NODE-EBM-00 / subdomain1
+ Endpoint #3
- Name : HanivalProductWSPort
- Service : {http://hanivalproductws. partner.net/}HanivalProductWSService
- Interfaces : {http://hanivalproductws. partner.net/}HanivalProductWS,
- Location (component / container / domain) : petals-bc-soap / NODE-EBM-00 / subdomain1
+ Endpoint #4
- Name : SemanticSpaceAggImplPort
- Service : {http://ws.aggregator.space.dsb.soa4all.eu/}SemanticSpaceAggImplService
- Interfaces : {http://ws.aggregator.space.dsb.soa4all.eu/}SemanticSpaceWS,
- Location (component / container / domain) : petals-bc-soap / NODE-OVH-00 / subdomain1
+ Endpoint #5
- Name : SemanticSpaceWSImplServiceEndpointOVH
- Service : {http://ws.space.dsb.soa4all.eu/}SemanticSpaceWSImplService
- Interfaces : {http://ws.space.dsb.soa4all.eu/}SemanticSpaceWS,
- Location (component / container / domain) : petals-bc-soap / NODE-OVH-00 / subdomain1
+ Endpoint #6
- Name : SemanticSpaceWSImplServiceEndpointEBM
- Service : {http://ws.space.dsb.soa4all.eu/}SemanticSpaceWSImplService
- Interfaces : {http://ws.space.dsb.soa4all.eu/}SemanticSpaceWS,
- Location (component / container / domain) : petals-bc-soap / NODE-EBM-00 / subdomain1
/>
… will be extended with more services too.
When generating client with the CXF (2.2.2 in this case, should apply to all…) Java API without any configuration file, here is the way to set the client timeout :
package org.ow2.petals.kernel.ws.client; import org.apache.cxf.endpoint.Client; import org.apache.cxf.frontend.ClientProxy; import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; import org.apache.cxf.transport.http.HTTPConduit; import org.apache.cxf.transports.http.configuration.HTTPClientPolicy; import org.ow2.petals.kernel.ws.api.RuntimeService; public class Main { private void createService() { long timeout = 10000L; JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(RuntimeService.class); factory.setAddress("http://localhost:9999/service/Runtime"); RuntimeService runtimeService = (RuntimeService) factory.create(); Client client = ClientProxy.getClient(runtimeService); if (client != null) { HTTPConduit conduit = (HTTPConduit) client.getConduit(); HTTPClientPolicy policy = new HTTPClientPolicy(); policy.setConnectionTimeout(timeout); policy.setReceiveTimeout(timeout); conduit.setClient(policy); } } }
Note that here the RuntimeService class is my JAXWS annotated class.
One more new release of OW2-EasyWSDL, the WSDL manipulation library.
The EasyWSDL team is pleased to announce the release of EasyWSDL 1.3
You can download it from: http://forge.ow2.org/project/showfiles.php?group_id=334&release_id=3454
Available in this version :
- Fix some bugs
- Improve import/include management
- Use URL instead of URI in WSDL reader
- Add SimpleContent tag management
- Change artifact name (More maven compliant…)
More information is available on EasyWSDL website: http://easywsdl.ow2.org/
Someones are saying that Maven is hard to domesticate… That’s true but when you you become Maven aware it really facilitate the developer’s life. More posts will come later on Maven… For now just an answer to guys who are always asking me (and others):
“Hey! Which module include this dependency? I need to update the version but I can not find where it is defined?!”
(Dédicace à Nico Jr
)
mvn dependency:tree
This plugin will give you the complete dependency tree of the current module. Thanks Maven!
Jacobo Matute from TheServerLabs wrote a very good tutorial on its blog about developping a SCA based application using JBI and especially using PEtALS SCA features. You can find the article here.
OW2 EasyWSDL WSDL manipulation library has just been released. This release fix many bugs and introduces some new tooling such as java2wsdl (create WSDL from Java interfaces) and xsd2xml (create XML from XSD definition).
EasyWSDL is easy since you can manipulate both WSDL 1.1 and WSDL 2.0 with the same object model.
// Read a WSDL 1.1 or 2.0 WSDLReader reader = WSDLFactory.newInstance().newWSDLReader(); Description desc = reader.readWSDL(new URI("http://file/path/document.wsdl")); // Write a WSDL 1.1 or 2.0 (depend of desc version) Document doc = WSDLFactory.newInstance().newWSDLWriter().getDocument(desc); // Create a WSDL 1.1 or 2.0 Description desc11 = WSDLFactory.newInstance().newDescription(WSDLVersionConstants.WSDL11); Description desc20 = WSDLFactory.newInstance().newDescription(WSDLVersionConstants.WSDL20);
Once the Description object is loaded from the WSDL document, you can maniulate all parts of the service description. Let’s look at endpoints :
// Endpoints take place in services. // Select a service Service service = desc.getServices().get(0); // List endpoints List endpoints = service.getEndpoints(); // Read specific endpoint Endpoint specificEndpoint = service.getEndpoint("endpointName"); // Add endpoint to service service.addEndpoint(specificEndpoint); // Remove a specific enpoint service.removeEndpoint("endpointName"); // Create endpoint Endpoint createdEndpoint = service.createEndpoint(); service.addEndpoint(createdEndpoint);
Easy!
The PEtALS Architecture document I wrote last winter has just been published. You can get it from the OW2 PEtALS web site or read from my slideshare account.
This is quite the same thing than the previous post where I introduced how to expose JAXWS service in PEtALS ESB with Maven. This time, let’s proxify a Web service in PEtALS with Maven.
Here is the Maven descriptor snippet :
<build> <plugins> <plugin> <groupId>org.ow2.petals</groupId> <artifactId>maven-petals-wsproxy</artifactId> <version>1.0-SNAPSHOT</version> <executions> <execution> <id>generate-jbi</id> <phase>package</phase> <configuration> <wsdl> http://localhost:8080/Service?wsdl </wsdl> </configuration> <goals> <goal>wsproxy</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
This will generate a JBI Service Assembly that you can then deploy intoo PEtALS to proxify the service defined in http://localhost:8080/Service?wsdl
You can give it a try, the snapshot version is available on the OW2 Maven repository…
Since I am always using command line tools such as Maven or Ant to create my project and to package them, I have just created a new Maven plugin to easily and quickly expose a JAXWS service in PEtALS with Maven. This plugin will generate the JBI Service Unit and Service Assembly from a Maven java project with just a few lines of Maven settings…
As an example, the following interface :
package org.ow2.petals; import javax.jws.WebMethod; import javax.jws.WebService; @WebService public interface Service { @WebMethod String ping(String input); }
and its implementation :
package org.ow2.petals; public class ServiceImpl implements Service { public String ping(String input) { return input; } }
will generate a Service Assembly idirectly deployable to PEtALS by the help of the Maven plugin :
<build> <plugins> <plugin> <groupId>org.ow2.petals</groupId> <artifactId>maven-petals-jaxws2jbi</artifactId> <version>1.0-SNAPSHOT</version> <executions> <execution> <id>generate-jbi</id> <phase>package</phase> <configuration> <className> org.ow2.petals.ServiceImpl </className> </configuration> <goals> <goal>java2jbi</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
The plugin takes the Service class, generates its associated WSDL file and the JBI descriptor and then package all into a Service Assembly.