You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Colin Sampaleanu <co...@exis.com> on 2002/08/16 18:11:30 UTC

How to initialize deployed services?

I asked a variant of this question a week ago, without any replies, so 
thought I would try again.

How are people typically initializing services they deploy? I think I am 
missing something. In some other SOAP toolkits, you take an existing 
object (which you have constructed as you need it), and bind it to an 
endpoint. In the AXIS deployment model (run admin client and feed it a 
*.wsdd file), there seems to be no easy mechanism to get this level of 
control, since AXIS is responsible for creating the object (either once, 
or on every call), and there doesn't even appear to be a way to pass 
parameters to the instance. If I am exposing server functionality via an 
object attached to a binding, I need to connect that object to other 
live objects in the VM.

Regards,
Colin



Re: How to initialize deployed services?

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Colin Sampaleanu" <co...@exis.com>
To: <ax...@xml.apache.org>
Sent: Friday, August 16, 2002 13:21
Subject: Re: How to initialize deployed services?
>
> >
> The problem there is you still need some way to differentiate 'this'
> instance of a service from another instance on the same host. I may be
> deploying the exact same service at 'x' number of endpoints, so for the
> purposes of getting config info (from ldap or wherever) an instance can
> not identify itself solely via the hostname. It needs some
> differentiator, a parameter that it can grab, or even the endpoint it is
> bound to, but it can't get that (can it?).

you can get it from the message context, but it is contrived in JAX-RPC. And
you need to get an inbound request before you know it (or before AxisServlet
inits AxisEngine, more to the point), so it is hard to boot up a server app
knowing your externally visible endpoint (which doesnt always map directly
to one of the local hostname name).

Maybe you could do demand config of an endpoint; I cant see any others
off-hand.

-steve


Re: How to initialize deployed services?

Posted by Colin Sampaleanu <co...@exis.com>.
Steve Loughran wrote:

>...
>
>>Along with the servletContext, I guess the other way you could get to
>>live objects is via JNDI and singletons...
>>
>>It would be nice if a minimal addition was implemented, where the .wsdd
>>file could specify parameters to the service. Steven suggested having
>>the service read in a config file with a name based on the hostname, but
>>this is not necessarily a dependency I want to have. Being able to pass
>>in some param to that instance of the service to identify it would help
>>in a big way...
>>    
>>
>my hostname based process worked in the 'when web services go bad' example
>as we had about 30 systems, split into 5 clusters and some dev boxes, but
>even then cluster-side it wasnt dynamic enough, to change a property on 4
>boxes needed four edits or a reinstall. This is why I like ldap.
>
>there is the ldap boot process: how do you find your server? I am using
>multicast IP, a service boots saying 'who is a config server', gets the list
>back then goes 'who knows about me, my hostname is "foo"'?; sort of like
>DHCP
>
>  
>
The problem there is you still need some way to differentiate 'this' 
instance of a service from another instance on the same host. I may be 
deploying the exact same service at 'x' number of endpoints, so for the 
purposes of getting config info (from ldap or wherever) an instance can 
not identify itself solely via the hostname. It needs some 
differentiator, a parameter that it can grab, or even the endpoint it is 
bound to, but it can't get that (can it?).

Colin



Re: How to initialize deployed services?

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Colin Sampaleanu" <co...@exis.com>
To: <ax...@xml.apache.org>
Sent: Friday, August 16, 2002 10:31 AM
Subject: Re: How to initialize deployed services?


> Thanks. I've now gone back in the archives and found that thread, called
> "Configuring a web service...", which was of some help. Too bad there
> isn't a way to deploy live objects. That approach really fits some
> scenarios a lot better.

yeah, it would be nice. .NET remoting lets you do this, which is why it is
my favourite of the two .NET stacks (the other reason is that it doesnt need
IIS, which must be a good thing).

Looks like a coding opportunity to me.

>
> Along with the servletContext, I guess the other way you could get to
> live objects is via JNDI and singletons...
>
> It would be nice if a minimal addition was implemented, where the .wsdd
> file could specify parameters to the service. Steven suggested having
> the service read in a config file with a name based on the hostname, but
> this is not necessarily a dependency I want to have. Being able to pass
> in some param to that instance of the service to identify it would help
> in a big way...

my hostname based process worked in the 'when web services go bad' example
as we had about 30 systems, split into 5 clusters and some dev boxes, but
even then cluster-side it wasnt dynamic enough, to change a property on 4
boxes needed four edits or a reinstall. This is why I like ldap.

there is the ldap boot process: how do you find your server? I am using
multicast IP, a service boots saying 'who is a config server', gets the list
back then goes 'who knows about me, my hostname is "foo"'?; sort of like
DHCP



Re: How to initialize deployed services?

Posted by Colin Sampaleanu <co...@exis.com>.
Thanks. I've now gone back in the archives and found that thread, called 
"Configuring a web service...", which was of some help. Too bad there 
isn't a way to deploy live objects. That approach really fits some 
scenarios a lot better.

Along with the servletContext, I guess the other way you could get to 
live objects is via JNDI and singletons...

It would be nice if a minimal addition was implemented, where the .wsdd 
file could specify parameters to the service. Steven suggested having 
the service read in a config file with a name based on the hostname, but 
this is not necessarily a dependency I want to have. Being able to pass 
in some param to that instance of the service to identify it would help 
in a big way...


Andrew Vardeman wrote:

> I've got a servlet that loads at webapp startup, reads config files, 
> and hangs information in the servletContext, which you can get at 
> through the Axis MessageContext.  I remember a post from Steve 
> Loughran a while back that mentioned a cleaner, less 
> transport-dependent way of deploying apps with config files, but it 
> seems like you'd still need to access the servletContext if you want 
> to get your hands on objects that are outside of Axis--
>
> Andrew
>
> At 12:11 PM 8/16/2002 -0400, you wrote:
>
>> I asked a variant of this question a week ago, without any replies, 
>> so thought I would try again.
>>
>> How are people typically initializing services they deploy? I think I 
>> am missing something. In some other SOAP toolkits, you take an 
>> existing object (which you have constructed as you need it), and bind 
>> it to an endpoint. In the AXIS deployment model (run admin client and 
>> feed it a *.wsdd file), there seems to be no easy mechanism to get 
>> this level of control, since AXIS is responsible for creating the 
>> object (either once, or on every call), and there doesn't even appear 
>> to be a way to pass parameters to the instance. If I am exposing 
>> server functionality via an object attached to a binding, I need to 
>> connect that object to other live objects in the VM.
>>
>> Regards,
>> Colin
>>
>>
>
>
>




Re: How to initialize deployed services?

Posted by Andrew Vardeman <an...@iastate.edu>.
I've got a servlet that loads at webapp startup, reads config files, and 
hangs information in the servletContext, which you can get at through the 
Axis MessageContext.  I remember a post from Steve Loughran a while back 
that mentioned a cleaner, less transport-dependent way of deploying apps 
with config files, but it seems like you'd still need to access the 
servletContext if you want to get your hands on objects that are outside of 
Axis--

Andrew

At 12:11 PM 8/16/2002 -0400, you wrote:
>I asked a variant of this question a week ago, without any replies, so 
>thought I would try again.
>
>How are people typically initializing services they deploy? I think I am 
>missing something. In some other SOAP toolkits, you take an existing 
>object (which you have constructed as you need it), and bind it to an 
>endpoint. In the AXIS deployment model (run admin client and feed it a 
>*.wsdd file), there seems to be no easy mechanism to get this level of 
>control, since AXIS is responsible for creating the object (either once, 
>or on every call), and there doesn't even appear to be a way to pass 
>parameters to the instance. If I am exposing server functionality via an 
>object attached to a binding, I need to connect that object to other live 
>objects in the VM.
>
>Regards,
>Colin
>
>