cxf-issues mailing list archives

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

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

Allard Buijze reopened CXF-870:
-------------------------------


Issue was said to be solved in 2.0.1, nut it still causes problems.

When the service implementation bean is advised (and thus the bean is proxied), CXF is unable
to generate the same web service from the bean as when it hasn't been advised.

Below is the mesage of the exception that is thrown.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pointOfSaleService':
Invocation of init method failed; nested exception is org.apache.cxf.service.factory.ServiceConstructionException:
Could not find definition for service $Proxy43Service.

The name of the service in the WSDL is PointOfSale. When I set this name in the spring configuration
(in the <jaxws:endpoint> element), I get a nullpointer exception.

> 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
>            Priority: Minor
>             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