I cannot reproduce that (GT 4.2.1): If I modify this property and fetch it
again, then i'm getting the new value:

logger.info((String) ctx.getProperty(org.apache.axis.Constants.MC_REMOTE_ADDR));
ctx.setProperty(org.apache.axis.Constants.MC_REMOTE_ADDR,"hello");
logger.info((String) ctx.getProperty(org.apache.axis.Constants.MC_REMOTE_ADDR));

(prints "hello" for the second logging statement to my logfile)

Note that setting this property does not have any functional consequence as far 
as
i know. The response to your WS request will NOT be sent to the new IP-address 
you
provided. Setting the remote address to 'hello' (which is a pretty odd address)
does not even cause an error.
As far as i know, this is so because whatever you set there will not be used.
The server-side socket of your request which will be used to send the response 
will
not be effected by changing this property in the MessageContext.

Martin

Dridi, Saber wrote:
Hi,

i have a question about the message context. Java WS Core fetches the host 
address from the request socket
(socket.getInetAddress().getHostAddress()) and adds it as a property to the message context. The web service fetches the remote address from the message context.
I have implemented a handler class to catch the request message:

...
import org.globus.wsrf.ResourceContext;
import org.apache.axis.Constants;
...
ResourceContext ctx = ResourceContext.getResourceContext();
String remoteAddress = (String) ctx.getProperty(Constants.MC_REMOTE_ADDR));



So i want to insert a new remote address:

ctx.setProperty(Constants.MC_REMOTE_ADDR, "192.168.33.1");


but in the web service the following method display the remote address 
127.0.1.1:

String remoteAddress = (String) 
ctx.getProperty(org.apache.axis.Constants.MC_REMOTE_ADDR);
System.out.println(remoteAddress);


Can someone please correct how to set a property in the message context.

thanks a lot
saber

Saber Dridi
Universität Siegen

Reply via email to