Thanks! This works like a charm.
I m still happy I've learnt about ThreadLocal today...

-----Original Message-----
From: Ian Roberts [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 16, 2008 4:09 PM
To: [email protected]
Subject: Re: getting the ip address in the action method

Yair Ben-Meir wrote:
> The problem is - how can I pass the IP to the method? The method's
arguments
> are according to the WSDL, I can't change them and add "ip" or something
> like that.

Store the IP address as a property of the Message in your interceptor:

message.put("my.package.ClientIP", ipAddress);

In your implementation class, add a

@Resource
private WebServiceContext wsCtx;

and you should then be able to access the message property through that:

wsCtx.getMessageContext().get("my.package.ClientIP")

Ian

-- 
Ian Roberts               | Department of Computer Science
[EMAIL PROTECTED]  | University of Sheffield, UK

Reply via email to