I figured out the solution. The below error is fixed as per below...
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Could
not find definition for service {http://gadget.acme.com/}GadgetServiceService
Add the below annotation to the implementing class.
@WebService(name = "GadgetService",
serviceName = "GadgetServiceService",
targetNamespace = "http://gadget.acme.com")
Noce: ServiceService ... that's Jax-ws convention to add "Service".
Anyway, now I see this warning,
WARNING: Could not find endpoint/port for
{http://gadget.acme.com}GadgetervicePort in wsdl. Creating default.
How do I get rid of that?
Inside my transport factory, getConduit...What's the deal with
GadgetServicePort1? What's the deal with that number 1?
targetInfo=BindingQName={http://gadget.acme.com}GadgetServiceServiceSoapBinding,
ServiceQName={http://gadget.acme.com}GadgetServiceService,
QName={http://gadget.acme.com}GadgetServicePort1
Thanks...
----- Original Message ----
From: Coder One <[email protected]>
To: [email protected]
Sent: Wed, January 27, 2010 2:15:28 AM
Subject: Custom Transport and Creating a JaxWS Client
CXF 2.2.5
I can't seem to create a client-side service instance to invoke my web service
via my custom transport. I followed the info at
http://cxf.apache.org/docs/jax-ws-java-first-with-jms-transport.html, but I am
sure I must have missed some steps.
For example, do I need to store a local copy of the WSDL and remove the port
info that refers to http from the WSDL? The JMS example referred to "jms://"
for the address. That is my "myproto", but where do I register "myproto://"
before using it in the factory?
Thanks,
Code to create the client:
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setWsdlURL("http://localhost:8084/gadget-server/gadgetService?wsdl");
factory.setAddress("myproto://abc");
// Just an interface that was used to implement the service. Also used on
server-side.
factory.setServiceClass(gadgetServiceClazz);
factory.create();
Exception
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Could
not find definition for service {http://gadget.acme.com/}GadgetServiceService.
at org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:126)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:408)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:521)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:271)
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:177)
at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51)
at
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
at
org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)