How to publish multiple webservice?

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

How to publish multiple webservice?

william he
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

 
     
Reply | Threaded
Open this post in threaded view
|

Re: How to publish multiple webservice?

Daniel Kulp
Administrator
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
[hidden email]
http://dankulp.com/blog
Reply | Threaded
Open this post in threaded view
|

Re: How to publish multiple webservice?

akis
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 <[hidden email]>
To: [hidden email]
Cc: William <[hidden email]>
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
[hidden email]
http://dankulp.com/blog



     
Reply | Threaded
Open this post in threaded view
|

Re: How to publish multiple webservice?

Daniel Kulp
Administrator
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 <[hidden email]>
> To: [hidden email]
> Cc: William <[hidden email]>
> 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
[hidden email]
http://dankulp.com/blog
Reply | Threaded
Open this post in threaded view
|

Re: How to publish multiple webservice?

akis
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 <[hidden email]>
To: [hidden email]
Cc: am am <[hidden email]>; William <[hidden email]>
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 <[hidden email]>
> To: [hidden email]
> Cc: William <[hidden email]>
> 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
[hidden email]
http://dankulp.com/blog



     
Reply | Threaded
Open this post in threaded view
|

Re: How to publish multiple webservice?

Daniel  Kulp
Administrator
In reply to this post by william he
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 <[hidden email]>
> To: [hidden email]
> Cc: am am <[hidden email]>; William <[hidden email]>
> 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 <[hidden email]>
> > To: [hidden email]
> > Cc: William <[hidden email]>
> > 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
[hidden email]
http://dankulp.com/blog
jpv
Reply | Threaded
Open this post in threaded view
|

Re: How to publish multiple webservice?

jpv
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 !


Reply | Threaded
Open this post in threaded view
|

Re: How to publish multiple webservice?

Daniel  Kulp
Administrator
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
[hidden email]
http://dankulp.com/blog
Talend - http://www.talend.com