The examples as shown don't work:
@WebService(name = "EchoService", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld")
this won't work because in the AnnotationServiceFactory, it does this:
if (webServiceAnnotation.getEndpointInterface() != null)
{
try
{
endpointInterface = loadClass(webServiceAnnotation.getEndpointInterface());
...
the problem is that, in the Annotation class, the default for endpointInterface is "", so if you leave it empty, it won't be null.
After supplying an endpointInterface (and hoping it could be the plain interface my Service bean implemented, without annotations), I got this:
java.lang.NullPointerException
at org.codehaus.xfire.annotations.AnnotationServiceFactory.createServiceNamespace(AnnotationServiceFactory.java:169)
at org.codehaus.xfire.annotations.AnnotationServiceFactory.create(AnnotationServiceFactory.java:103)
at org.codehaus.xfire.service.object.ObjectServiceFactory.create(ObjectServiceFactory.java:97)
at org.codehaus.xfire.annotations.AnnotationServiceFactory.create(AnnotationServiceFactory.java:63)
the problem is that it assumes it can get an annotation from the interface (which I wish could be the other way around). Ok, so I point the endpointInterface at my same implementation class, and try again. The problem now is that it can't create a service name for me if none is provided (it should probably use the "name") so I can't access the service, even though it's created.
So what I end up having to specify is this:
@WebService (
name = "OrgQueryService",
serviceName = "OrqQueryService",
targetNamespace = "http://www.eplus.org/Organization",
endpointInterface = "com.eplus.app.service.export.orgquery.OrgQueryServiceImpl"
)
public class OrgQueryServiceImpl implements OrgQueryService {
which is considerably more than in the example.