Hi there,

I'm using 2.0.2 version to generate the client side of an existing web
service. 
I have already managed to write a client with another framework using
jax-rpc technology, I nowwant to migrate to jax-ws with CXF framework

When running the client web service, I'm facing the following exception :

11:25:21,246 [main] INFO  support.DefaultListableBeanFactory  -
Pre-instantiating singletons in
[EMAIL PROTECTED]:
defining beans
[cxf,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.binding.xml.XMLBindingFactory,org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory,{http://anpe.fr/DirectoryServices/}StructureServicesSoap.http-conduit];
root of factory hierarchy
9 nov. 2007 11:25:22
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL
INFO: Creating Service {http://anpe.fr/DirectoryServices/}StructureServices
from WSDL:
file:/D:/bea_dev/SocleSapiens/StructureServices/src/main/resources/structureservices.wsdl
11:26:31,137 [main] INFO  structures.StructureServicesImpl  - Client web
service StructureServices initialisé
9 nov. 2007 11:26:42 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
INFO: Interceptor has thrown exception, unwinding now
java.lang.ClassCastException: java.lang.String
        at
org.apache.cxf.jaxws.interceptors.HolderOutInterceptor.handleMessage(HolderOutInterceptor.java:95)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
        at
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
        at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
        at $Proxy31.getMailAddress(Unknown Source)
        at
fr.anpe.sapiens.services.structures.StructureServicesImpl.getMailAddress(StructureServicesImpl.java:84)
        at
fr.anpe.sapiens.services.structures.StructureServicesTest.testGetMailAddress(StructureServicesTest.java:51)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
        at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

The service I'm calling looks like this (copied from generated code) :

@ResponseWrapper(targetNamespace = "http://anpe.fr/DirectoryServices/";,
className = "fr.anpe.directoryservices.GetMailAddressResponse", localName =
"GetMailAddressResponse")
@RequestWrapper(targetNamespace = "http://anpe.fr/DirectoryServices/";,
className = "fr.anpe.directoryservices.GetMailAddress", localName =
"GetMailAddress")
@WebResult(targetNamespace = "http://anpe.fr/DirectoryServices/";, name =
"GetMailAddressResult")
@WebMethod(action = "http://anpe.fr/DirectoryServices/GetMailAddress";,
operationName = "GetMailAddress")
public java.lang.String getMailAddress(
    @WebParam(targetNamespace = "http://anpe.fr/DirectoryServices/";, name =
"applicationName")
    java.lang.String applicationName,
    @WebParam(targetNamespace = "http://anpe.fr/DirectoryServices/";, name =
"code")
     java.lang.String code
);

It takes 2 string as parameter and return one, it can't be any simpler, I
have really no idea of what could be wrong ...
Any help would be very welcome.
   
Kind regards,

Joel 

ps : I have already asked help on this problem on a previous post, I prefer
to write a new post to clarify things as previous post was related to
another subject. 
-- 
View this message in context: 
http://www.nabble.com/classCastExcception-in-web-service-client-generated-with-CXF-tf4790840.html#a13704962
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to