XFire
  1. XFire
  2. XFIRE-546

@WebMethod ignored - all methods is visible from webservice

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1.2
    • Fix Version/s: None
    • Component/s: Annotations
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Annotation @WebMethod is totaly ignored.
      Now all methods starting with 'get' is visible from webservice.

        Activity

        Hide
        Dan Diephouse added a comment -

        Are you using it on an interface? @WebMethod is only valid on concrete classes, not interfaces.

        Show
        Dan Diephouse added a comment - Are you using it on an interface? @WebMethod is only valid on concrete classes, not interfaces.
        Hide
        Jara Cesnek added a comment -

        @WebService(name="phones",serviceName="phones",targetNamespace="http://eos.ws.daisy.marbes.cz")
        public class WSPhones {

        protected final Log logger = LogFactory.getLog(getClass());

        protected DAOEos dao;
        public void setDao(DAOEos dao)

        { this.dao = dao; }

        @XmlType(namespace="http://eos.ws.daisy.marbes.cz")
        public static class Phone implements Serializable {
        protected Integer id_tlf;
        public Integer getId_tlf()

        { return id_tlf; }

        public void setId_tlf(Integer id_tlf)

        { this.id_tlf = id_tlf; }

        protected String tellinka;
        public String getTellinka()

        { return tellinka; }

        public void setTellinka(String tellinka)

        { this.tellinka = tellinka; }

        }

        @WebMethod
        public List<Phone> getPhonesByFilter() throws DaisyException

        { .... }

        }

        ===========
        In wsdl is present both

        • List<Phone> getPhonesByFilter()
        • void setDao(DAOEos dao)
        Show
        Jara Cesnek added a comment - @WebService(name="phones",serviceName="phones",targetNamespace="http://eos.ws.daisy.marbes.cz") public class WSPhones { protected final Log logger = LogFactory.getLog(getClass()); protected DAOEos dao; public void setDao(DAOEos dao) { this.dao = dao; } @XmlType(namespace="http://eos.ws.daisy.marbes.cz") public static class Phone implements Serializable { protected Integer id_tlf; public Integer getId_tlf() { return id_tlf; } public void setId_tlf(Integer id_tlf) { this.id_tlf = id_tlf; } protected String tellinka; public String getTellinka() { return tellinka; } public void setTellinka(String tellinka) { this.tellinka = tellinka; } } @WebMethod public List<Phone> getPhonesByFilter() throws DaisyException { .... } } =========== In wsdl is present both List<Phone> getPhonesByFilter() void setDao(DAOEos dao)
        Hide
        Fabian Linz added a comment -

        Why is a WebMethod annotation not valid on an interface? Actually XFire uses the information given by a WebMethod annotation like the name and the action when it is defined in an interface.

        Also the XFire user guide gives an example with a WebMethod in an interface ([1]).

        I experience the same as Jara. Using the JAXWSServiceFactory every method is offered by XFire no matter if a WebMethod annotation is provided or not. If it is provided the information from the annotation are used no matter if they are defined in the interface or the implementation class.

        [1] http://xfire.codehaus.org/JSR+181+Annotations

        Show
        Fabian Linz added a comment - Why is a WebMethod annotation not valid on an interface? Actually XFire uses the information given by a WebMethod annotation like the name and the action when it is defined in an interface. Also the XFire user guide gives an example with a WebMethod in an interface ( [1] ). I experience the same as Jara. Using the JAXWSServiceFactory every method is offered by XFire no matter if a WebMethod annotation is provided or not. If it is provided the information from the annotation are used no matter if they are defined in the interface or the implementation class. [1] http://xfire.codehaus.org/JSR+181+Annotations
        Hide
        Dan Diephouse added a comment -

        It is valid on the interface. However the lack of a @WebMethod attribute does not designate that the method is not a web method.

        Jara - can you paste your configuration?

        Show
        Dan Diephouse added a comment - It is valid on the interface. However the lack of a @WebMethod attribute does not designate that the method is not a web method. Jara - can you paste your configuration?
        Hide
        Jara Cesnek added a comment -

        My configuration :
        Spring 1.2.8 + xfire-all-1.1.2.jar (xfire-all-1.1.jar, xfire-all-1.2-RC.jar - none working but in the past it is sure working fine)

        Application-context.xml

        <bean id="webServicesAgent" class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping" abstract="true">
        <property name="typeMappingRegistry"><ref bean="xfire.typeMappingRegistry"/></property>
        <property name="xfire"><ref bean="xfire"/></property>
        <property name="webAnnotations">
        <bean class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations"/>
        </property>
        <property name="urlPrefix"><value>/webservices/</value></property>
        <property name="interceptors">
        <list>
        <ref local="globalStatsHandlerInterceptor"/>
        <ref local="openSessionInView"/>
        </list>
        </property>
        </bean>

        eos-servlet.xml

        <bean parent="webServicesAgent"/>

        • so nothing special
        Show
        Jara Cesnek added a comment - My configuration : Spring 1.2.8 + xfire-all-1.1.2.jar (xfire-all-1.1.jar, xfire-all-1.2-RC.jar - none working but in the past it is sure working fine) Application-context.xml <bean id="webServicesAgent" class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping" abstract="true"> <property name="typeMappingRegistry"><ref bean="xfire.typeMappingRegistry"/></property> <property name="xfire"><ref bean="xfire"/></property> <property name="webAnnotations"> <bean class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations"/> </property> <property name="urlPrefix"><value>/webservices/</value></property> <property name="interceptors"> <list> <ref local="globalStatsHandlerInterceptor"/> <ref local="openSessionInView"/> </list> </property> </bean> eos-servlet.xml <bean parent="webServicesAgent"/> so nothing special
        Hide
        Jara Cesnek added a comment -

        Workaround is using
        @WebService(endpointInterface="cz.marbes.daisy.modules.eos.ws.WSIPhones")
        as described in http://xfire.codehaus.org/JSR+181+Annotations
        but there is problem with unnamed parameters in0,in1,in2, etc...

        Show
        Jara Cesnek added a comment - Workaround is using @WebService(endpointInterface="cz.marbes.daisy.modules.eos.ws.WSIPhones") as described in http://xfire.codehaus.org/JSR+181+Annotations but there is problem with unnamed parameters in0,in1,in2, etc...
        Hide
        Edina Pimp added a comment -

        I think the spec dictates this is an issue:

        >paste<
        If the implementation bean does not implement a service endpoint interface, all
        public methods other than those inherited from java.lang.Object will be exposed
        as Web Service operations. This behavior can be overridden by using the
        WebMethod annotation to specify explicitly those public methods that are to be
        exposed. If a WebMethod annotation is present, only the methods to which it is
        applied are exposed.

        Show
        Edina Pimp added a comment - I think the spec dictates this is an issue: >paste< If the implementation bean does not implement a service endpoint interface, all public methods other than those inherited from java.lang.Object will be exposed as Web Service operations. This behavior can be overridden by using the WebMethod annotation to specify explicitly those public methods that are to be exposed. If a WebMethod annotation is present, only the methods to which it is applied are exposed.
        Hide
        Cliff Meyers added a comment -

        This is especially problematic when your service class extends another class with a large number of methods. The workaround involves overriding every method in the class with a call to super in the implementation and then annotating each method with @WebMethod(exclude=true). Is this bug scheduled to be fixed any time soon?

        Show
        Cliff Meyers added a comment - This is especially problematic when your service class extends another class with a large number of methods. The workaround involves overriding every method in the class with a call to super in the implementation and then annotating each method with @WebMethod(exclude=true). Is this bug scheduled to be fixed any time soon?
        Hide
        Jara Cesnek added a comment -

        Can I ask Dan if he feel this as issue and will fix it ?
        Or definitely no and I should fix it myself ?

        Waiting for this long time and nothing happens.

        Sorry for bitching )

        Show
        Jara Cesnek added a comment - Can I ask Dan if he feel this as issue and will fix it ? Or definitely no and I should fix it myself ? Waiting for this long time and nothing happens. Sorry for bitching )
        Hide
        Cliff Meyers added a comment -

        What Jara said, x2

        Show
        Cliff Meyers added a comment - What Jara said, x2
        Hide
        tsc added a comment -

        Is there any plan to fix this bug?

        Has this issue been fixed in CXF version 2.0.3?

        Show
        tsc added a comment - Is there any plan to fix this bug? Has this issue been fixed in CXF version 2.0.3?

          People

          • Assignee:
            Dan Diephouse
            Reporter:
            Jara Cesnek
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: