You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by William <wi...@gmail.com> on 2010/06/24 14:48:55 UTC

How to publish multiple webservice?

Hello guys,

I just want to know how to publish multiple web services? Is it  
correct to just repeat the following codes? Any better implementation?

JaxWsProxyFactoryBean factory = new  JaxWsProxyFactoryBean();
......
factory.create;


Thanks,
William

  
     

Re: How to publish multiple webservice?

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday 03 March 2011 5:54:20 AM jpv wrote:
> Hi Daniel
> 
> But what about url, ip and so on  ?
> .....
> Endpoint.publish("http://localhost:8080/service", new Service());
> 
> OK, http://localhost:8080/service works fine (CXF works fine anyway !).
> 
> But suppose localhost -> 172.99.123.45 and  (via DNS)
> http://myservice.mycorp/service -> http://172.99.123.45:8080
> 
> well, i can't reach http://172.99.123.45:8080/service nor
> http://myservice.mycompagny/service
> How do i have to deal with that ?  Maybe my question is stupid !

I think the jetty stuff by default only exposes the service on the exact host 
you specify.  Thus, if you do:

 Endpoint.publish("http://myservice.mycompagny:8080/service", new Service());

it would be only on the public port.  You can TRY:
"http://0.0.0.0:8080/service"
(I'm not sure on that)



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Re: How to publish multiple webservice?

Posted by jpv <jp...@gmail.com>.
Hi Daniel 

But what about url, ip and so on  ?
.....
Endpoint.publish("http://localhost:8080/service", new Service()); 

OK, http://localhost:8080/service works fine (CXF works fine anyway !).

But suppose localhost -> 172.99.123.45 and  (via DNS)
http://myservice.mycorp/service -> http://172.99.123.45:8080

well, i can't reach http://172.99.123.45:8080/service nor
http://myservice.mycompagny/service
How do i have to deal with that ?  Maybe my question is stupid ! 




--
View this message in context: http://cxf.547215.n5.nabble.com/How-to-publish-multiple-webservice-tp566254p3407757.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: How to publish multiple webservice?

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday 01 July 2010 5:44:16 pm am am wrote:
> Hi, thanks for the reply.
> You are right, I did something wrong and got the exception. It works, but
> the problem I have is, that this way I have 2 wsdl.
> Is it possible using the endpoint to have just 1 wsdl with 2
> services/portTypes?

Not at this time for java-first cases.   Each published endpoint creates it's 
own endpoint.    If you mannually merge the wsdls and kind of convert them to 
wsdl first, you could as they could share the wsdl.

Dan

> 
> 
> 
> Only the first servi
> 
> Thanks!
> 
> 
> 
> 
> 
> ________________________________
> From: Daniel Kulp <dk...@apache.org>
> To: users@cxf.apache.org
> Cc: am am <ak...@yahoo.com>; William <wi...@gmail.com>
> Sent: Wed, June 30, 2010 8:21:41 PM
> Subject: Re: How to publish multiple webservice?
> 
> On Saturday 26 June 2010 5:45:25 am am am wrote:
> > Hi,
> > 
> > I need something similar. Is it possible to publish multiple services
> > under the same url? I tried as you say
> > Endpoint.publish("http://localhost/service", new Service1());
> > Endpoint.publish("http://localhost/service2", new Service2());
> > 
> > But i get an address is already bind exception (which makes sense I
> > guess). But  I do not want to use different tcp port in the url. Must be
> > same port. How can I do that? The web service must be implemented as
> > standalone(not in a container)
> 
> That should work perfectly fine, at least with CXF.    Can you post the
> full stack trace?
> 
> Dan
> 
> > Thank you.
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > ________________________________
> > From: Daniel Kulp <dk...@apache.org>
> > To: users@cxf.apache.org
> > Cc: William <wi...@gmail.com>
> > Sent: Fri, June 25, 2010 8:04:15 PM
> > Subject: Re: How to publish multiple webservice?
> > 
> > On Thursday 24 June 2010 8:48:55 am William wrote:
> > > Hello guys,
> > > 
> > > I just want to know how to publish multiple web services? Is it
> > > correct to just repeat the following codes? Any better implementation?
> > > 
> > > JaxWsProxyFactoryBean factory = new  JaxWsProxyFactoryBean();
> > > ......
> > > factory.create;
> > 
> > Generally yes.   Either that or just do
> > 
> > Endpoint.publish(....)
> > 
> > a bunch of times.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: How to publish multiple webservice?

Posted by am am <ak...@yahoo.com>.
Hi, thanks for the reply. 
You are right, I did something wrong and got the exception. It works, but the 
problem I have is, that this way I have 2 wsdl.
Is it possible using the endpoint to have just 1 wsdl with 2 services/portTypes? 



Only the first servi

Thanks!





________________________________
From: Daniel Kulp <dk...@apache.org>
To: users@cxf.apache.org
Cc: am am <ak...@yahoo.com>; William <wi...@gmail.com>
Sent: Wed, June 30, 2010 8:21:41 PM
Subject: Re: How to publish multiple webservice?

On Saturday 26 June 2010 5:45:25 am am am wrote:
> Hi,
> 
> I need something similar. Is it possible to publish multiple services under
> the same url? I tried as you say
> Endpoint.publish("http://localhost/service", new Service1());
> Endpoint.publish("http://localhost/service2", new Service2());
> 
> But i get an address is already bind exception (which makes sense I guess).
> But  I do not want to use different tcp port in the url. Must be same port.
> How can I do that? The web service must be implemented as standalone(not in
> a container)

That should work perfectly fine, at least with CXF.    Can you post the full 
stack trace?

Dan


> 
> Thank you.
> 
> 
> 
> 
> 
> 
> 
> ________________________________
> From: Daniel Kulp <dk...@apache.org>
> To: users@cxf.apache.org
> Cc: William <wi...@gmail.com>
> Sent: Fri, June 25, 2010 8:04:15 PM
> Subject: Re: How to publish multiple webservice?
> 
> On Thursday 24 June 2010 8:48:55 am William wrote:
> > Hello guys,
> > 
> > I just want to know how to publish multiple web services? Is it
> > correct to just repeat the following codes? Any better implementation?
> > 
> > JaxWsProxyFactoryBean factory = new  JaxWsProxyFactoryBean();
> > ......
> > factory.create;
> 
> Generally yes.   Either that or just do
> 
> Endpoint.publish(....)
> 
> a bunch of times.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog



      

Re: How to publish multiple webservice?

Posted by Daniel Kulp <dk...@apache.org>.
On Saturday 26 June 2010 5:45:25 am am am wrote:
> Hi,
> 
> I need something similar. Is it possible to publish multiple services under
> the same url? I tried as you say
> Endpoint.publish("http://localhost/service", new Service1());
> Endpoint.publish("http://localhost/service2", new Service2());
> 
> But i get an address is already bind exception (which makes sense I guess).
> But  I do not want to use different tcp port in the url. Must be same port.
> How can I do that? The web service must be implemented as standalone(not in
> a container)

That should work perfectly fine, at least with CXF.    Can you post the full 
stack trace?

Dan


> 
> Thank you.
> 
> 
> 
> 
> 
> 
> 
> ________________________________
> From: Daniel Kulp <dk...@apache.org>
> To: users@cxf.apache.org
> Cc: William <wi...@gmail.com>
> Sent: Fri, June 25, 2010 8:04:15 PM
> Subject: Re: How to publish multiple webservice?
> 
> On Thursday 24 June 2010 8:48:55 am William wrote:
> > Hello guys,
> > 
> > I just want to know how to publish multiple web services? Is it
> > correct to just repeat the following codes? Any better implementation?
> > 
> > JaxWsProxyFactoryBean factory = new  JaxWsProxyFactoryBean();
> > ......
> > factory.create;
> 
> Generally yes.   Either that or just do
> 
> Endpoint.publish(....)
> 
> a bunch of times.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: How to publish multiple webservice?

Posted by am am <ak...@yahoo.com>.
Hi,

I need something similar. Is it possible to publish multiple services under the same url?
I tried as you say
Endpoint.publish("http://localhost/service", new Service1());
Endpoint.publish("http://localhost/service2", new Service2());

But i get an address is already bind exception (which makes sense I guess).
But  I do not want to use different tcp port in the url. Must be same port. 
How can I do that? The web service must be implemented as standalone(not in a container)

Thank you.







________________________________
From: Daniel Kulp <dk...@apache.org>
To: users@cxf.apache.org
Cc: William <wi...@gmail.com>
Sent: Fri, June 25, 2010 8:04:15 PM
Subject: Re: How to publish multiple webservice?

On Thursday 24 June 2010 8:48:55 am William wrote:
> Hello guys,
> 
> I just want to know how to publish multiple web services? Is it
> correct to just repeat the following codes? Any better implementation?
> 
> JaxWsProxyFactoryBean factory = new  JaxWsProxyFactoryBean();
> ......
> factory.create;

Generally yes.   Either that or just do

Endpoint.publish(....)

a bunch of times.


-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog



      

Re: How to publish multiple webservice?

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday 24 June 2010 8:48:55 am William wrote:
> Hello guys,
> 
> I just want to know how to publish multiple web services? Is it
> correct to just repeat the following codes? Any better implementation?
> 
> JaxWsProxyFactoryBean factory = new  JaxWsProxyFactoryBean();
> ......
> factory.create;

Generally yes.   Either that or just do

Endpoint.publish(....)

a bunch of times.


-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog