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 rouble <ro...@gmail.com> on 2009/01/15 20:57:31 UTC

webservice design question

Hi All,

I have a question on the basics of deploying web services.

I want to understand, when tomcat deploys a service, does it create
one instance of the class specified in className (in my case,
ServiceBindingImpl) -- and continuously call the methods on that
instance? Or does it create a new instance of className for every new
connection?

For my application, I have a soap message coming in, that needs to be
communicated to a main server process.

I have written a axis based tomcat web service to receive the soap
message, and it works great. Now in the business logic of the allowed
method, I have the webservice send the soap message, using socket IPC,
to a main server process.

Now, I am wondering if I can move the entire server process into the
tomcat webservice. I am trying to cut down on the number of components
and the socket IPC.

More specifically, does it make sense to have ServiceBindingImpl be my
main server process? Or is there another way to have the server
process be part of the tomcat webservice.

I am wondering if someone can direct me on the best way to design this.

TIA,
rouble

Re: webservice design question

Posted by rouble <ro...@gmail.com>.
Hi All,

So, Sameera set me on the right path, and I figured I could create a
singleton shared object to service all requests, in axis, by adding:
      <parameter name="scope" value="application"/>

My next question is, I noticed the constructor of the web service is
called only when a method is invoked. Is there a way I can kick off
the webservice sooner? I need to execute some startup code.

In other words, is there a way to start and stop a axis web service
(that has application scope)?

Cheers
Rouble

On Fri, Jan 16, 2009 at 1:05 AM, rouble <ro...@gmail.com> wrote:
> Hi Sameera,
>
> Thanks -- that looks like what I was looking for.
>
> However, I forgot to mention something, I am using Axis, and not
> Axis2. Is there a way to define these scopes in Axis also? I am
> particularly interested in the Appliation scope.
>
> Cheers
> rouble
>
> On Fri, Jan 16, 2009 at 12:29 AM, Sameera Jayasoma
> <sa...@gmail.com> wrote:
>>
>>
>> On Fri, Jan 16, 2009 at 1:27 AM, rouble <ro...@gmail.com> wrote:
>>>
>>> Hi All,
>>>
>>> I have a question on the basics of deploying web services.
>>>
>>> I want to understand, when tomcat deploys a service, does it create
>>> one instance of the class specified in className (in my case,
>>> ServiceBindingImpl) -- and continuously call the methods on that
>>> instance? Or does it create a new instance of className for every new
>>> connection?
>>
>> This behavior is  depend on the Axis2 session scope that you have used.
>> Please have a look at the following article.
>>
>> http://wso2.org/library/231
>>>
>>>
>>> For my application, I have a soap message coming in, that needs to be
>>> communicated to a main server process.
>>>
>>> I have written a axis based tomcat web service to receive the soap
>>> message, and it works great. Now in the business logic of the allowed
>>> method, I have the webservice send the soap message, using socket IPC,
>>> to a main server process.
>>>
>>> Now, I am wondering if I can move the entire server process into the
>>> tomcat webservice. I am trying to cut down on the number of components
>>> and the socket IPC.
>>>
>>> More specifically, does it make sense to have ServiceBindingImpl be my
>>> main server process? Or is there another way to have the server
>>> process be part of the tomcat webservice.
>>>
>>> I am wondering if someone can direct me on the best way to design this.
>>>
>>> TIA,
>>> rouble
>>
>>
>>
>> --
>> Sameera
>> http://sameera-jayasoma.blogspot.com/
>> http://www.flickr.com/photos/sameera-jayasoma
>>
>
>
>
> --
> this message is composed of 100% recycled ascii
>



-- 
this message is composed of 100% recycled ascii

Re: webservice design question

Posted by rouble <ro...@gmail.com>.
Hi Sameera,

Thanks -- that looks like what I was looking for.

However, I forgot to mention something, I am using Axis, and not
Axis2. Is there a way to define these scopes in Axis also? I am
particularly interested in the Appliation scope.

Cheers
rouble

On Fri, Jan 16, 2009 at 12:29 AM, Sameera Jayasoma
<sa...@gmail.com> wrote:
>
>
> On Fri, Jan 16, 2009 at 1:27 AM, rouble <ro...@gmail.com> wrote:
>>
>> Hi All,
>>
>> I have a question on the basics of deploying web services.
>>
>> I want to understand, when tomcat deploys a service, does it create
>> one instance of the class specified in className (in my case,
>> ServiceBindingImpl) -- and continuously call the methods on that
>> instance? Or does it create a new instance of className for every new
>> connection?
>
> This behavior is  depend on the Axis2 session scope that you have used.
> Please have a look at the following article.
>
> http://wso2.org/library/231
>>
>>
>> For my application, I have a soap message coming in, that needs to be
>> communicated to a main server process.
>>
>> I have written a axis based tomcat web service to receive the soap
>> message, and it works great. Now in the business logic of the allowed
>> method, I have the webservice send the soap message, using socket IPC,
>> to a main server process.
>>
>> Now, I am wondering if I can move the entire server process into the
>> tomcat webservice. I am trying to cut down on the number of components
>> and the socket IPC.
>>
>> More specifically, does it make sense to have ServiceBindingImpl be my
>> main server process? Or is there another way to have the server
>> process be part of the tomcat webservice.
>>
>> I am wondering if someone can direct me on the best way to design this.
>>
>> TIA,
>> rouble
>
>
>
> --
> Sameera
> http://sameera-jayasoma.blogspot.com/
> http://www.flickr.com/photos/sameera-jayasoma
>



-- 
this message is composed of 100% recycled ascii

Re: webservice design question

Posted by Sameera Jayasoma <sa...@gmail.com>.
On Fri, Jan 16, 2009 at 1:27 AM, rouble <ro...@gmail.com> wrote:

> Hi All,
>
> I have a question on the basics of deploying web services.
>
> I want to understand, when tomcat deploys a service, does it create
> one instance of the class specified in className (in my case,
> ServiceBindingImpl) -- and continuously call the methods on that
> instance? Or does it create a new instance of className for every new
> connection?


This behavior is  depend on the Axis2 session scope that you have used.
Please have a look at the following article.

http://wso2.org/library/231

>
>
> For my application, I have a soap message coming in, that needs to be
> communicated to a main server process.
>
> I have written a axis based tomcat web service to receive the soap
> message, and it works great. Now in the business logic of the allowed
> method, I have the webservice send the soap message, using socket IPC,
> to a main server process.
>
> Now, I am wondering if I can move the entire server process into the
> tomcat webservice. I am trying to cut down on the number of components
> and the socket IPC.
>
> More specifically, does it make sense to have ServiceBindingImpl be my
> main server process? Or is there another way to have the server
> process be part of the tomcat webservice.
>
> I am wondering if someone can direct me on the best way to design this.
>
> TIA,
> rouble
>



-- 
Sameera
http://sameera-jayasoma.blogspot.com/
http://www.flickr.com/photos/sameera-jayasoma