cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Diephouse <...@envoisolutions.com>
Subject Re: Deploying multiple endpoints/ports for a service
Date Mon, 20 Nov 2006 19:36:23 GMT
Good question. Quick summary:

ServiceFactorys construct the Service
ServerFactorys construct the Server
EndpointImpl is there to implement the JAX-WS SPI and pretty much 
delegates to the JaxWsServerFactory right now. With one caveat, it has 
logic to recognize WebServiceProviders, where as JaxWsServiceFactory can 
only handle the normal JAX-WS @WebService style classes. In the 
WebServiceProvider case it has the ServerFactory use the 
ProviderServiceFactory. Otherwise the normal JaxWsServiceFactory is used.

I'd like to unify JaxWsServiceFactory & ProviderServiceFactory at some 
point so EndpointImpl is purely a wrapper around it, just a bit short on 
time at this point though. I will be doing more work to unify the 
dispatch/provider/web service cases as I clean up the databinding code 
in the near future.

Does that help explain it?

- Dan

Soltysik, Seumas wrote:

>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