You can set the portName attribute on the @WebService annotation as well.
Dan
On Wed January 27 2010 11:14:53 pm Coder One wrote:
> 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}GadgetServiceServiceSoapBin
> ding, 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:12
> 6) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFr
> omWSDL(ReflectionServiceFactoryBean.java:408) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServ
> iceModel(ReflectionServiceFactoryBean.java:521) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflect
> ionServiceFactoryBean.java:271) at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFa
> ctoryBean.java:177) at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Ab
> stractWSDLBasedEndpointFactory.java:100) at
> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51
> ) at
> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBe
> an.java:102) at
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.ja
> va:115)
>
--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog