I need the port to be dynamic though. That is, the WSDL contract is supported by multiple services by different parties, so when I use the JaxWsProxyFactoryBean to create a client, I need to set the actual address at this point.
So far so good, my Conduit is picking up the custom address. I am hoping that on the service/server side, the Destination will line up as well. Thanks, ----- Original Message ---- From: Daniel Kulp <[email protected]> To: [email protected] Cc: Coder One <[email protected]> Sent: Fri, January 29, 2010 12:53:58 PM Subject: Re: Custom Transport and Creating a JaxWS Client Actually, I'm probably wrong. When you setup the factory, you would normally call factory.setServiceName and factory.setEndpointName to set the service and endpoint/port names to match what would be in the wsdl. Dan On Fri January 29 2010 3:46:13 pm Daniel Kulp wrote: > 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}GadgetServiceServiceSoapB > >in 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?wsd > >l" ); 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:1 > >2 6) at > > > > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceF > >r omWSDL(ReflectionServiceFactoryBean.java:408) at > > > > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeSer > >v iceModel(ReflectionServiceFactoryBean.java:521) at > > > > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflec > >t ionServiceFactoryBean.java:271) at > > > > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceF > >a ctoryBean.java:177) at > > > > org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(A > >b stractWSDLBasedEndpointFactory.java:100) at > > > > org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:5 > >1 ) at > > > > org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryB > >e an.java:102) at > > > > org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.j > >a va:115) > -- Daniel Kulp [email protected] http://www.dankulp.com/blog
