cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-870) WebService methods generated from implementation instead of interface
Date Fri, 31 Aug 2007 13:42:30 GMT

    [ https://issues.apache.org/jira/browse/CXF-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12524085
] 

Daniel Kulp commented on CXF-870:
---------------------------------


The AOP case (using proxies) is a different issue.   See my comments in:
https://issues.apache.org/jira/browse/CXF-874

Basically, according to JAX-WS, if the annotation on the object does NOT specify the endpointInterface,
we MUST process all methods on the object itself.   With a Proxy, the @WebService annotation
doesn't exist.   Thus, all methods are processed.

The workaround is to specify the implementorClass attribute on the jaxws:endpoint (in your
case, would set to com.company.services.ServiceProviderImpl) so the runtime can find the proper
annotation and find the correct information.




> WebService methods generated from implementation instead of interface
> ---------------------------------------------------------------------
>
>                 Key: CXF-870
>                 URL: https://issues.apache.org/jira/browse/CXF-870
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0, 2.0.1
>         Environment: CXF 2.0, Spring 2, JAX-WS
>            Reporter: Allard Buijze
>            Assignee: Daniel Kulp
>             Fix For: 2.0.2
>
>
> -- Description of problem --
> When CXF creates a service provider for a given JAX-WS-annotated (implementation) class,
it tries to create a WebService operation for each method in that implementation class.
> In the case of a spring bean, there could be getter and setter methods. CXF will fail
in creating WS operations from these methods and fail to publish the service.
> -- Suggested solution --
> The solution to this problem would be to only generate WS operations from the methods
in the interface(s) the class implements.
> An example of a spring context that will cause CXF to fail is as follows:
> <jaxws:endpoint id="helloWorld" implementor="#serverBean" address="/HelloWorld" />
> <bean id="serverBean" class="com.company.services.ServiceProviderImpl">
>     <property name="myPropetry" value="MyValue" />
> </bean>
> -- Workaround --
> A workaround to the problem can be to use constructor injection. This removes the need
for setter methods.
> The following spring context shows how this can be done:
> <jaxws:endpoint id="helloWorld" implementor="#serverBean" address="/HelloWorld" />
> <bean id="serverBean" class="com.company.services.ServiceProviderImpl">
>     <<constructor-arg index="0" value="MyValue" />
> </bean>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message