Sep
03
2008
0

Google Chrome - Oh So Shiny and New

I had to write a quick post about Google Chrome because the hype fire needs to keep burning. I downloaded Chrome today just to give it a spin. I have not set it up as my default browser just yet because I am going to need to put it through some trials first. Hopefully, a version for OS X is on its way because I really like the speed and the simplicity of the user interface. If Google stays focused on providing a browser that is geared towards supporting Internet applications then I think we will see some great things from Chrome. 

Written by R.J. Salicco in: Commentary |
Sep
02
2008
0

Apache CXF: Open Source Service Framework

Web Service development has come a long way. I had some experience with XFire a few years ago and thought Web Service development could not get any easier. Then XFire became the Apache CXF project. I wanted to take a peak at Apache CXF so the other night I put together a simple echo Web Service. Alright, if you would like to follow along, you can create a Web Service in about 10 minutes:

First, we need our dependencies: (download them here)

...
commons-logging-1.1.1.jar
cxf-2.1.2.jar
FastInfoset-1.2.2.jar
geronimo-activation_1.1_spec-1.0.2.jar
geronimo-annotation_1.0_spec-1.1.1.jar
geronimo-javamail_1.4_spec-1.3.jar
geronimo-jaxws_2.1_spec-1.0.jar
geronimo-servlet_2.5_spec-1.2.jar
geronimo-stax-api_1.0_spec-1.0.1.jar
geronimo-ws-metadata_2.0_spec-1.1.2.jar
jaxb-api-2.1.jar
jaxb-impl-2.1.7.jar
jaxen-1.1.jar
jdom-1.0.jar
jetty-6.1.9.jar
jetty-util-6.1.9.jar
neethi-2.0.4.jar
saaj-api-1.3.jar
saaj-impl-1.3.jar
spring-beans-2.0.8.jar
spring-context-2.0.8.jar
spring-core-2.0.8.jar
spring-web-2.0.8.jar
stax-utils-20060502.jar
wsdl4j-1.6.2.jar
wstx-asl-3.2.4.jar
xml-resolver-1.2.jar
XmlSchema-1.4.2.jar
...

Second, we need our service interface: (note the @WebService annotation)

...
package com.thejavajar.service;

import javax.jws.WebService;

@WebService
public interface EchoServiceIfc {
        public String echo(String text);
}
...

Next, we need an implementation of our service interface: (note the @WebService annotation)

...
package com.thejavajar.service;

import javax.jws.WebService;

@WebService
public class EchoServiceImpl implements EchoServiceIfc {
        public String echo(String text) {
                return text;
        }
}
...

Finally, we can create a simple Java class that will start a server and expose our service:

...
package com.thejavajar.server;

import org.apache.cxf.frontend.ServerFactoryBean;

import com.thejavajar.service.EchoServiceIfc;
import com.thejavajar.service.EchoServiceImpl;

public class Server {
	public static void main(String[] args) {
		EchoServiceImpl echoServiceImpl = new EchoServiceImpl();

		// Create our Server
		ServerFactoryBean svrFactory = new ServerFactoryBean();
		svrFactory.setServiceClass(EchoServiceIfc.class);
		svrFactory.setAddress("http://localhost:9000/echo");
		svrFactory.setServiceBean(echoServiceImpl);
		svrFactory.create();
	}
}
...

Above, we set a few properties of the ServerFactoryBean that we have instantiated. We basically set up our service interface, our address (URL) to our service endpoint and the implementation class. We can run this as a normal Java application and browse over to http://localhost:9000/echo?wsdl and see our WSDL generated for our echo service.

There is nothing too complicated about the echo service. It is basically a Java interface, an implementation class and a few annotations. This is a great start for any developer who wants to start developing Web Services without getting overwhelmed with the full capabilities and features of Apache CXF or the spec. For more information, head on over to http://cxf.apache.org.

Eclipse Project: apache-cxf-echo-service.zip

Written by R.J. Salicco in: Development | Tags: , ,
Sep
02
2008
0

BarCamp Tampa Bay 2008

I am looking forward to attending BarCamp Tampa Bay. I attended BarCamp Orlando last year and I am extremely pleased to know that the concept of the “unconference” will be coming to my backyard. Working with the Tampa Java User Group has shown me how passionate our community is about Java and through my channels, I know that there is a passionate Ruby community as well here in the Tampa Bay area. You can register for the event at http://www.barcamptampabay.com.

Written by R.J. Salicco in: Commentary |

Axiomatic IT Incorporated | Aeros Theme | TheBuckmaker.com WordPress Themes