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 Owen Mills <ow...@gmail.com> on 2009/01/15 01:57:29 UTC

Automatically engage Axis Module on every service call

Hi,

I'm currently working on an application which uses Axis generated
stubs from a java web start client.  I basically want to add security
to the header of outgoing requests sent from this client.

I'm trying to use a module archive and if I explicitly engage the
module from within the client code using
axisStub._getServiceClient().engageModule("testModule"); when the
service is invoked using that stub, the module archive is executed
correctly and the header of the request is updated with the
appropriate security token.

However, I would much prefer to have the module engaged on every
service call without having to explicitly engage it in the client
code.  I've tried playing around with settings in the axis2.xml file,
but no matter what I try, I can't seem to engage the module without
adding axisStub._getServiceClient().engageModule("testModule"); to the
client code.

>From what I have read it seems that this sort of functionality can be
achieved on the server side using the service.xml file, but cannot be
achieved through configuration alone on the client side.  Is this
correct?

Cheers,

Owen

Re: Automatically engage Axis Module on every service call

Posted by Sameera Jayasoma <sa...@gmail.com>.
On Thu, Jan 15, 2009 at 6:27 AM, Owen Mills <ow...@gmail.com> wrote:

> Hi,
>
> I'm currently working on an application which uses Axis generated
> stubs from a java web start client.  I basically want to add security
> to the header of outgoing requests sent from this client.
>
> I'm trying to use a module archive and if I explicitly engage the
> module from within the client code using
> axisStub._getServiceClient().engageModule("testModule"); when the
> service is invoked using that stub, the module archive is executed
> correctly and the header of the request is updated with the
> appropriate security token.
>
> However, I would much prefer to have the module engaged on every
> service call without having to explicitly engage it in the client
> code.  I've tried playing around with settings in the axis2.xml file,
> but no matter what I try, I can't seem to engage the module without
> adding axisStub._getServiceClient().engageModule("testModule"); to the
> client code.


Normally, you can put the module ref in a client-side axis2.xml. Then you
need to use this axis2.xml when you are instantiating your axis2Stub.

>
>
> From what I have read it seems that this sort of functionality can be
> achieved on the server side using the service.xml file, but cannot be
> achieved through configuration alone on the client side.  Is this
> correct?
>
> Cheers,
>
> Owen
>



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

Re: Automatically engage Axis Module on every service call

Posted by Owen Mills <ow...@gmail.com>.
Thank you very much for getting back to me.

I believe I had tried this, but couldn't get it to work.  I'm sure I
was probably doing something wrong.

Due to time constraints and my overall lack of knowledge on the axis
architecture, I've decided to avoid using the module archive.

Thanks for you help,

Owen

On Fri, Jan 16, 2009 at 6:51 PM, Amila Suriarachchi
<am...@gmail.com> wrote:
>
>
> On Thu, Jan 15, 2009 at 6:27 AM, Owen Mills <ow...@gmail.com> wrote:
>>
>> Hi,
>>
>> I'm currently working on an application which uses Axis generated
>> stubs from a java web start client.  I basically want to add security
>> to the header of outgoing requests sent from this client.
>>
>> I'm trying to use a module archive and if I explicitly engage the
>> module from within the client code using
>> axisStub._getServiceClient().engageModule("testModule"); when the
>> service is invoked using that stub, the module archive is executed
>> correctly and the header of the request is updated with the
>> appropriate security token.
>>
>> However, I would much prefer to have the module engaged on every
>> service call without having to explicitly engage it in the client
>> code.  I've tried playing around with settings in the axis2.xml file,
>> but no matter what I try, I can't seem to engage the module without
>> adding axisStub._getServiceClient().engageModule("testModule"); to the
>> client code.
>
> In this case you need to create a configuration context, giving the path to
> axis2.xml and use that
> configuration context to create the stub.
>
> thanks,
> Amila.
>>
>>
>> From what I have read it seems that this sort of functionality can be
>> achieved on the server side using the service.xml file, but cannot be
>> achieved through configuration alone on the client side.  Is this
>> correct?
>>
>> Cheers,
>>
>> Owen
>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>

Re: Automatically engage Axis Module on every service call

Posted by Amila Suriarachchi <am...@gmail.com>.
On Thu, Jan 15, 2009 at 6:27 AM, Owen Mills <ow...@gmail.com> wrote:

> Hi,
>
> I'm currently working on an application which uses Axis generated
> stubs from a java web start client.  I basically want to add security
> to the header of outgoing requests sent from this client.
>
> I'm trying to use a module archive and if I explicitly engage the
> module from within the client code using
> axisStub._getServiceClient().engageModule("testModule"); when the
> service is invoked using that stub, the module archive is executed
> correctly and the header of the request is updated with the
> appropriate security token.
>
> However, I would much prefer to have the module engaged on every
> service call without having to explicitly engage it in the client
> code.  I've tried playing around with settings in the axis2.xml file,
> but no matter what I try, I can't seem to engage the module without
> adding axisStub._getServiceClient().engageModule("testModule"); to the
> client code.


In this case you need to create a configuration context, giving the path to
axis2.xml and use that
configuration context to create the stub.

thanks,
Amila.

>
>
> From what I have read it seems that this sort of functionality can be
> achieved on the server side using the service.xml file, but cannot be
> achieved through configuration alone on the client side.  Is this
> correct?
>
> Cheers,
>
> Owen
>



-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/