users@glassfish.java.net

Service deployment with _at_WebService and endpointInterface no longer working

From: <mark_at_javector.com>
Date: Tue, 14 Feb 2006 12:51:58 -0700

I rebuilt glassfish last night (Feb 13th) and some of my sample apps are no
longer working. It seems as if the way that the container interprets the
@WebService annotation has changed.

I have the following service implementation bean:

@WebService(
    endpointInterface="com.example.req.RequestOrderPort",
    wsdlLocation="WEB-INF/wsdl/RequestOrder.wsdl")
public class RequestOrder implements RequestOrderPort {

With the following service endpoint interface (SEI):

@WebService(
    name = "RequestOrderPort",
    targetNamespace = "http://www.example.com/req",
    wsdlLocation = "WEB-INF/wsdl/RequestOrder.wsdl")
public interface RequestOrderPort {

This used to work OK. Glassfish, when deploying the service implementation bean
would look to the annotations on the SEI (e.g., for targetNamespace) as the
basis for deployment. So, in this case, my web service would be deployed in
the namespace http://www.example.com/req.

However, with the build of Glassfish from Feb 13th, this same sample app is now
getting deployed in teh namespace http://samples. That is the default for the
service implementation bean - which has a package of simply 'samples'. So,
Glassfish is no longer reading the targetNamespace from the SEI annotations.

According to my reading of JSR-181, the current Glassfish implementation of
@WebService for a service implementation bean is wrong. I think that the
targetNamespace should be taken from the annotations on the SEI.

Per JSR-181 pg 16 (Sec 4.1.1) ...
"[The endpointInterface attribute provides] the complete name of the service
endpoint interface defining the service's abstract Web Service contract. The
annotatnion allows the developer to sparate the interface contract from the
implementaion. If this annotatnion is present, the service endpoint interface
is used to determine the abstract WSDL contract (portType and bindigns). ...."

Of course, I could be wrong about this. It wouldn't be the first time that I've
misread the specs :-)

Can anyone shed some light on this issue?

-- Mark