it's my fault I pointed the java2wsdl to a interface and not the actual
implementation.
Nino Saturnino Martinez Vazquez Wael wrote:
Hi
In my tour de cxf, i've now come to the point where I have a test that
checks that the wsdl scheme are registered, and another test that
checks that its looking okay. Next step are to test if the endpoints
are working. Since im using jaxws it seems that I need a wsdl for
this, inorder to create a servicebean. So I decided to get one
generated for me using the java2wsdl plugin for maven[1].
However my test are failing with an exception when trying to generate
the servicebean:
org.apache.cxf.service.factory.ServiceConstructionException: Could not
find definition for service
{http://jayway.com/hello_world_soap_http}HelloWorld.
at
org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:114)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:286)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:379)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:173)
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:98)
at com.jayway.GreeterTest.testEndpoint(GreeterTest.java:46)
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)
its the last line here that generates the error:
ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
URL resource = getClass().getResource("HelloWorld.wsdl");
assertNotNull(resource);
bean.setWsdlURL(resource.toString());
bean.setBus(bus);
bean.setServiceClass(HelloWorldImpl.class);
HelloWorldImpl helloWorld = new HelloWorldImpl();
BeanInvoker invoker = new BeanInvoker(helloWorld);
--> Service service = bean.create();
I dont understand how this is possible, since I've run java2wsdl...
But as im new I could be doing something wrong..
To get the complete project go here, and take a look in
greetertest.java in package com.jayway :
http://www.fileshost.com/en/file/22660/basic-zip.html
[1]=http://cwiki.apache.org/CXF20DOC/maven-integration-and-plugin.html
--
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684