You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "C. Manchet" <ce...@orange-ftgroup.com> on 2008/09/30 10:21:42 UTC

JaxWsProxyFactoryBean creation fails if the value of serviceClass property doesn't ended with "Service"

Hi,

The JaxWsProxyFactoryBean creation fails if the name attribute of
<wsdl:service> doesn't ended with "Service".

Example :

--> In the WSDL I have : <wsdl:service name="Securite">.
The generated corresponding Service class : Securite.java
In the Spring configuration file :
	<bean id="securiteServiceFactory"
class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">	
		<property name="serviceClass" value="test.securite.client.cxf.Securite"/>
		<property name="address" 
value="http://localhost:9000/securitecxf/services/Securite"/>
		<property name="wsdlURL" value="classpath:wsdl/securite.wsdl" />
	</bean>

I have the exception :
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'securiteProxy' defined in class path resource
[beans_securite.xml]: Instantiation of bean failed; nested exception is
org.springframework.beans.factory.BeanDefinitionStoreException: Factory
method [public java.lang.Object
org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create()] threw exception; nested
exception is org.apache.cxf.service.factory.ServiceConstructionException:
Could not find definition for service
{http://cxf.client.securite.test/}SecuriteService.

--> If I modify the service name in the  WDSL (<wsdl:service
name="SecuriteService">, and so the generated corresponding Service class is
SecuriteService.java) and use the above Spring configuration file, it's OK.

--> If I set the serviceClass property to
"test.securite.client.cxf.SecuriteService" (that is the correct value of the
property), I have this exception :"Could not find definition for service
{http://cxf.client.securite.test/}SecuriteServiceService".

Thanks for you reply
-- 
View this message in context: http://www.nabble.com/JaxWsProxyFactoryBean-creation-fails-if-the-value-of-serviceClass-property-doesn%27t-ended-with-%22Service%22-tp19737751p19737751.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: JaxWsProxyFactoryBean creation fails if the value of serviceClass property doesn't ended with "Service"

Posted by "C. Manchet" <ce...@orange-ftgroup.com>.
Hi,
I try the 2nd solution, so I modify the Spring Configuration and it's OK now
:

  	<bean id="serviceName" class="javax.xml.namespace.QName">
		<constructor-arg type="java.lang.String" value="urn:Securite"/>
 		<constructor-arg type="java.lang.String" value="Securite"/> 		
 	</bean>
 	
 	<bean id="endpointName" class="javax.xml.namespace.QName">
 		<constructor-arg type="java.lang.String" value="urn:Securite"/>
 		<constructor-arg type="java.lang.String" value="SecuriteSOAP11port"/> 		
 	</bean>
	<bean id="securiteServiceFactory"
class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">	
		<property name="serviceClass"
value="test.securite.client.cxf.SecuritePortType"/>
		<property name="address"
value="http://localhost:9000/securitecxf/services/Securite"/>
		<property name="wsdlURL" value="classpath:wsdl/securite.wsdl" />
		<property name="serviceName" ref="serviceName"/>		
		<property name="endpointName" ref="endpointName"/>						
	</bean>

I think the first solution is not the good way, because we are on the client
side and use the classes generated by wsdl2java and don't want to modify
them.

Perhaps you could explain in the documentation these JAXWsProxyFactoryBean's
properties and their default values (N.B. if the endpointName is not found
in wsdl, the (unique ?) port defined in WSDL is used).

The serviceClass property is the service endpoint Interface, and not the
Service class as I believed.


Thank you very much for your help.
-- 
View this message in context: http://www.nabble.com/JaxWsProxyFactoryBean-creation-fails-if-the-value-of-serviceClass-property-doesn%27t-ended-with-%22Service%22-tp19737751p19757117.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: JaxWsProxyFactoryBean creation fails if the value of serviceClass property doesn't ended with "Service"

Posted by Daniel Kulp <dk...@apache.org>.

You need to either:

1) set the service name in the @WebService annotation of the service 
class to match what's in the wsdl.

2) Set the serviceName (and probably endpointName) properties on the 
JaxWsProxyFactoryBean 

Be default, if neither is specified, it follows the JAX-WS rules to map 
your classname to a service name and checks the wsdl for that.   In your 
case, it isn't found.

Dan




On Tuesday 30 September 2008, C. Manchet wrote:
> Hi,
>
> The JaxWsProxyFactoryBean creation fails if the name attribute of
> <wsdl:service> doesn't ended with "Service".
>
> Example :
>
> --> In the WSDL I have : <wsdl:service name="Securite">.
> The generated corresponding Service class : Securite.java
> In the Spring configuration file :
> 	<bean id="securiteServiceFactory"
> class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
> 		<property name="serviceClass"
> value="test.securite.client.cxf.Securite"/> <property name="address"
> value="http://localhost:9000/securitecxf/services/Securite"/>
> 		<property name="wsdlURL" value="classpath:wsdl/securite.wsdl" />
> 	</bean>
>
> I have the exception :
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'securiteProxy' defined in class path resource
> [beans_securite.xml]: Instantiation of bean failed; nested exception
> is org.springframework.beans.factory.BeanDefinitionStoreException:
> Factory method [public java.lang.Object
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create()] threw exception;
> nested exception is
> org.apache.cxf.service.factory.ServiceConstructionException: Could not
> find definition for service
> {http://cxf.client.securite.test/}SecuriteService.
>
> --> If I modify the service name in the  WDSL (<wsdl:service
> name="SecuriteService">, and so the generated corresponding Service
> class is SecuriteService.java) and use the above Spring configuration
> file, it's OK.
>
> --> If I set the serviceClass property to
> "test.securite.client.cxf.SecuriteService" (that is the correct value
> of the property), I have this exception :"Could not find definition
> for service {http://cxf.client.securite.test/}SecuriteServiceService".
>
> Thanks for you reply



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog