cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Soltysik, Seumas" <Seumas.Solty...@iona.com>
Subject RE: Deploying multiple endpoints/ports for a service
Date Mon, 20 Nov 2006 19:19:51 GMT
Hi Dan,
I am a little confused between the use of JaxWsServerFactoryBean and JaxWsSericeFactoryBean.
Currently I am deploying an endpoint using this code:


        JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
        serviceFactory.setBus(bus);
        serviceFactory.setInvoker(new BeanInvoker(impl));
        serviceFactory.setServiceClass(impl.getClass());
        serviceFactory.setWsdlURL(wsdlLoc);
        
        endpoint = new  EndpointImpl(bus, impl, serviceFactory);
        endpoint.publish(address);

The code you show demonstrates a different way of deploying an Endpoint using JaxWsServerFactory.
Is one way preferable to another? What are the differences between the two?

Thanks,
Seumas

-----Original Message-----
From: Dan Diephouse [mailto:dan@envoisolutions.com]
Sent: Monday, November 20, 2006 1:35 PM
To: cxf-dev@incubator.apache.org
Subject: Re: Deploying multiple endpoints/ports for a service


I think you can do something like this:

sf = new JaxWsServerFactoryBean();
sf.setEndpointName(new QName("myport");
sf.setServiceClass(MyServiceInterface.class); // could use impl here too 
I think
sf.getServiceFactory().setInvoker(new JAXWSMethodInvoker(myServiceImpl);
Server server = sf.create();

rinse and repeat for all the endpoints you want.

Normally what happens is the ServerFactoryBean gets the endpoint name 
(we use wsdl 2 terminology here) from the ServiceFactory, which in turn 
reads the annotations. But setEndpointName() overrides this.

- Dan

Soltysik, Seumas wrote:

>Hi,
>Is it possible to deploy multiple endpoints using the same implementation class? In other
words if you have a service which defines two ports, how would you activate/deploy both ports/endpoints
using the same generated Java impl. I don't see any test cases that test this scenario. Furthermore
it appears that the code relies upon the portname being included as part of an annotation.
If so, this means that a single java impl probably could not be used for two separate endpoints.
>Regards,
>Seumas 
>
>  
>


-- 
Dan Diephouse
(616) 971-2053
Envoi Solutions LLC
http://netzooid.com


Mime
View raw message