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 Torsten Rüger <to...@firsthop.com> on 2002/04/16 08:33:43 UTC

Newbie Instantiation question

Moi,

so I just got my "hello world" (userguide/example3) to work and all 
looks fine.

But for real life, I want to access existing objects. So axis wouldn't 
intantiate the object, especially not for every call to the service.

Is there a way to describe this using the wsdd. For example to specify a 
factory method for the class ?
As in:

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

 <service name="MyService" provider="java:RPC">
  <parameter name="className" value="samples.userguide.example3.MyService"/>
#### guess work ####
  <parameter name="factoryMethod" value="my.package.class.staticMethod" >
    <arg  name="uri" />  ## or <arg name="serviceName"/>
### ??
  <parameter name="allowedMethods" value="*"/>
 </service>

</deployment>

Any other ideas how to do this are welcome ,

    Thanks
        Torsten


Re: Newbie Instantiation question

Posted by Torsten Rüger <to...@firsthop.com>.
Jean-Marc Taillant wrote:

>Hi,
>I thinks you speak about scope in web service. You can specify scope for
>your service with an extra parameter in wsdd file:
>
>...
><Parameter name="scope" value="Application"/>
>...
>
Ok, that sounds sort of promising. Do I take it that then the service 
would be only instantiated once ? Still, by who, or how ?
And where do I find this documented ?

 From the User guide:

"The skeleton contains an implementation of the AddressBook service.  
This implementation is either passed into the skeleton on construction, 
or an instance of the generated implementation is created.  When the 
AXIS engine calls the skeleton's addEntry method, it simply delegates 
the invocation to the real implementation's addEntry method."

So I understand I could use the *WSDL*2Java tool, generate those 
skeletons and pass my implementation in. But how ? Same question again, 
who instantiates the Skeleton ?

Thanks
    Torsten




Re: Newbie Instantiation question

Posted by Jean-Marc Taillant <ta...@bst.bsf.alcatel.fr>.
Hi,
I thinks you speak about scope in web service. You can specify scope for
your service with an extra parameter in wsdd file:

...
<Parameter name="scope" value="Application"/>
...

By default, this parameter is set to Session

Regards

Jean MArc
----- Original Message -----
From: "Torsten Rüger" <to...@firsthop.com>
To: <ax...@xml.apache.org>
Sent: Thursday, April 18, 2002 9:23 AM
Subject: Re: Newbie Instantiation question


> Anybody ?
>
> I still don't know even wheather this is too stupid a question or noone
> knows the answer, or I didn't make myself clear ?
>
> Any help apreciated ,
>
> Torsten
>
> > Moi,
> >
> > so I just got my "hello world" (userguide/example3) to work and all
> > looks fine.
> >
> > But for real life, I want to access existing objects. So axis wouldn't
> > intantiate the object, especially not for every call to the service.
> >
> > Is there a way to describe this using the wsdd. For example to specify
> > a factory method for the class ?
> > As in:
> >
> > <deployment xmlns="http://xml.apache.org/axis/wsdd/"
> >            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
> >
> > <service name="MyService" provider="java:RPC">
> >  <parameter name="className"
> > value="samples.userguide.example3.MyService"/>
> > #### guess work ####
> >  <parameter name="factoryMethod" value="my.package.class.staticMethod" >
> >    <arg  name="uri" />  ## or <arg name="serviceName"/>
> > ### ??
> >  <parameter name="allowedMethods" value="*"/>
> > </service>
> >
> > </deployment>
> >
> > Any other ideas how to do this are welcome ,
> >
> >    Thanks
> >        Torsten
>
>
>
>


Re: Newbie Instantiation question

Posted by Torsten Rüger <to...@firsthop.com>.
Anybody ?

I still don't know even wheather this is too stupid a question or noone 
knows the answer, or I didn't make myself clear ?

Any help apreciated ,

Torsten

> Moi,
>
> so I just got my "hello world" (userguide/example3) to work and all 
> looks fine.
>
> But for real life, I want to access existing objects. So axis wouldn't 
> intantiate the object, especially not for every call to the service.
>
> Is there a way to describe this using the wsdd. For example to specify 
> a factory method for the class ?
> As in:
>
> <deployment xmlns="http://xml.apache.org/axis/wsdd/"
>            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
>
> <service name="MyService" provider="java:RPC">
>  <parameter name="className" 
> value="samples.userguide.example3.MyService"/>
> #### guess work ####
>  <parameter name="factoryMethod" value="my.package.class.staticMethod" >
>    <arg  name="uri" />  ## or <arg name="serviceName"/>
> ### ??
>  <parameter name="allowedMethods" value="*"/>
> </service>
>
> </deployment>
>
> Any other ideas how to do this are welcome ,
>
>    Thanks
>        Torsten