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 "Shellman, Joel" <Jo...@summit.fiserv.com> on 2003/04/24 01:47:24 UTC
Custom Service Startup
I'm exploring writing Junit tests for web service with Axis, and I'd like to have control over instantiation of the service.
Ideally, from within a filter (or a servlet that gets loaded on startup first), I could programmatically send instances to Axis of the services I want made available so that way I can have complete control over their instantiation and configuration.
Or, specify a Factory that Axis then uses to get the service instance:
In wsdd: <service factory="MyServiceFactory.getMyService()">
Or, I'd like to be able to do something like:
public class MyWebService {
public MyWebService(ConfigFactory fact) {
// ...
}
}
Is anything like that possible?
Thanks,
-joel
Re: Custom Service Startup
Posted by Steve Loughran <st...@iseran.com>.
Shellman, Joel wrote:
> I'm exploring writing Junit tests for web service with Axis, and I'd like to have control over instantiation of the service.
>
> Ideally, from within a filter (or a servlet that gets loaded on startup first), I could programmatically send instances to Axis of the services I want made available so that way I can have complete control over their instantiation and configuration.
>
>
> Or, specify a Factory that Axis then uses to get the service instance:
>
> In wsdd: <service factory="MyServiceFactory.getMyService()">
>
>
> Or, I'd like to be able to do something like:
>
> public class MyWebService {
> public MyWebService(ConfigFactory fact) {
> // ...
> }
> }
>
> Is anything like that possible?
probably not yet, but you could maybe add it for Axis1.2. I'd envisage
you give the classname of a class that implements some interface of a
name like AxisFactory, Axis would create an instance of the factory then
invoke an Object CreateObject(ParameterString) to create new
objects...the param string would be whatever you specify in the wsdd.
That way we get simple flexiblity without too much reflection (which is
always slow)