On Thursday 20 May 2004 23:38, Nelson Minar wrote:
> Argh! Don't use system properties, or ThreadLocals, or the like.
>
> >> I suggest having the Handler store the data in the Axis
> >> MessageContext, then read it back out in the Service.
> >
> >Can you give me an example?
>
> In your Handler:
>
> public void invoke(MessageContext context) throws AxisFault {
> Object data = ...;
> context.setProperty("MyData", data);
> }
>
> In your service method:
>
> public foo myService(int a, String b) {
> MessageContext context = MessageContext.getCurrentContext();
> Object data = context.getProperty("MyData");
> }
>
>
> Underneath the scenes MessageContext.getCurrentContext() is
> actually using a ThreadLocal to do things. But let Axis do that
> itself, no need to do your own.
Hm, that's actually what I want to do! And the setProperty takes
normal Object as parameters or does it need Strings?
Thanks! That was very good information!
Konstantinos