Deploying multiple endpoints/ports for a service

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Deploying multiple endpoints/ports for a service

Soltysik, Seumas
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
Reply | Threaded
Open this post in threaded view
|

Re: Deploying multiple endpoints/ports for a service

Dan Diephouse-2
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

Reply | Threaded
Open this post in threaded view
|

RE: Deploying multiple endpoints/ports for a service

Soltysik, Seumas
In reply to this post by Soltysik, Seumas
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:[hidden email]]
Sent: Monday, November 20, 2006 1:35 PM
To: [hidden email]
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

Reply | Threaded
Open this post in threaded view
|

Re: Deploying multiple endpoints/ports for a service

Dan Diephouse-2
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:[hidden email]]
>Sent: Monday, November 20, 2006 1:35 PM
>To: [hidden email]
>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

Reply | Threaded
Open this post in threaded view
|

RE: Deploying multiple endpoints/ports for a service

Soltysik, Seumas
In reply to this post by Soltysik, Seumas
So in essence because I am not bound to using using the EndpointImpl class, I probably should use the JaxWsServiceFactory to setup my endpoints/listeners, right? It looks like I am going to have to change how I set the wsdl location. It looks like I am going to have to create a WSDLDestinationFactory from my wsdl location and then inject it into the ServerFactoryBean.

-----Original Message-----
From: Dan Diephouse [mailto:[hidden email]]
Sent: Monday, November 20, 2006 2:36 PM
To: [hidden email]
Subject: Re: Deploying multiple endpoints/ports for a service


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:[hidden email]]
>Sent: Monday, November 20, 2006 1:35 PM
>To: [hidden email]
>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

Reply | Threaded
Open this post in threaded view
|

Re: Deploying multiple endpoints/ports for a service

Dan Diephouse-2
Why would you have to change how you set the WSDL URL? Just do:

serverFactory.getServiceFactory().setWsdlUrl(...);

The ServiceFactory is accessible just like before.

- Dan

Soltysik, Seumas wrote:

>So in essence because I am not bound to using using the EndpointImpl class, I probably should use the JaxWsServiceFactory to setup my endpoints/listeners, right? It looks like I am going to have to change how I set the wsdl location. It looks like I am going to have to create a WSDLDestinationFactory from my wsdl location and then inject it into the ServerFactoryBean.
>
>-----Original Message-----
>From: Dan Diephouse [mailto:[hidden email]]
>Sent: Monday, November 20, 2006 2:36 PM
>To: [hidden email]
>Subject: Re: Deploying multiple endpoints/ports for a service
>
>
>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:[hidden email]]
>>Sent: Monday, November 20, 2006 1:35 PM
>>To: [hidden email]
>>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

Reply | Threaded
Open this post in threaded view
|

RE: Deploying multiple endpoints/ports for a service

Soltysik, Seumas
In reply to this post by Soltysik, Seumas
Right. Thanks, I'll give this a try.

-----Original Message-----
From: Dan Diephouse [mailto:[hidden email]]
Sent: Monday, November 20, 2006 3:15 PM
To: [hidden email]
Subject: Re: Deploying multiple endpoints/ports for a service


Why would you have to change how you set the WSDL URL? Just do:

serverFactory.getServiceFactory().setWsdlUrl(...);

The ServiceFactory is accessible just like before.

- Dan

Soltysik, Seumas wrote:

>So in essence because I am not bound to using using the EndpointImpl class, I probably should use the JaxWsServiceFactory to setup my endpoints/listeners, right? It looks like I am going to have to change how I set the wsdl location. It looks like I am going to have to create a WSDLDestinationFactory from my wsdl location and then inject it into the ServerFactoryBean.
>
>-----Original Message-----
>From: Dan Diephouse [mailto:[hidden email]]
>Sent: Monday, November 20, 2006 2:36 PM
>To: [hidden email]
>Subject: Re: Deploying multiple endpoints/ports for a service
>
>
>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:[hidden email]]
>>Sent: Monday, November 20, 2006 1:35 PM
>>To: [hidden email]
>>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