I have to disagree... I'm going to be writing some of this up but I've moved to a completely declarative annotation-driven style of adding services to my POJOs. I've just set up my application framework to handle automatic webservice exporting with XFire, and I can't see how it could be easier using a different editor (and who's going to use Beehive as their main editor?). I haven't moved to Java5 yet, so I'm using commons-attributes. Here's what a webservice class looks like:
/**
* OrgQueryServiceImpl
*
* @@WebService(name = "OrgQueryService", targetNamespace = "
http://www.eplus.org/Organization")
* @@org.codehaus.xfire.annotations.commons.soap.SOAPBinding(style = 1, use = 1, parameterStyle = 0)
*
* @author Jason Carreira <jcarreira at eplus dot com>
*/
public class OrgQueryServiceImpl implements OrgQueryService {
private OrganizationDao organizationDao;
public OrgQueryServiceImpl(OrganizationDao organizationDao) {
this.organizationDao = organizationDao;
}
/**
* @@WebMethod(action="urn:getOrganizationNames")
* @@.return WebResult("organizationNames")
*
* @return
*/
public String[] getOrganizations() {
List orgs = organizationDao.findAll();
if (orgs == null) { return new String[0]; };
String[] names = new String[orgs.size()];
for (int i = 0; i < orgs.size(); i++) {
Organization org = (Organization) orgs.get(i);
names[i] = org.getName();
}
return names;
}
}
That's it. When I register that bean with Spring (as just a bean), like this:
<bean id="orgQueryService" class="com.eplus.app.service.OrgQueryServiceImpl">
<constructor-arg>
<ref bean="organizationDao"/>
</constructor-arg>
</bean>
It's automatically exported as a WebService.
XFire is a nice library, I recommend taking a look... It's still got some stuff to iron out, but they seem to be heading in the right direction.
If you want the simplest way to start using JSR 181 annotations I recommend Apache Beehive. Beehive WSM has full support for JSR 181 and leverages Apache Axis for its SOAP implementation. You can leverage your Axis experience with the simplicity of Java 5 annotations.Additionally, for accessing those web services, check out the Beehive web service control.http://incubator.apache.org/beehiveGarrett ConatyBEA Systems, Inc.