axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Afkham Azeez <afk...@gmail.com>
Subject RE: Identify IP address of the source request
Date Sat, 02 Jul 2011 02:04:40 GMT
The MessageContext is set as a thread local variable when a request is
received. In fact, for a msg context to be created, either a message should
be received or sent. A valid msg context will be accessible in your
operation implementation methods.
On Jul 1, 2011 2:23 AM, "Matta, Geethamadhurima" <
geethamadhurima.matta@citi.com> wrote:
> Deepal,
>
> Following is the code:
> ---------------------------
> public void init(ServiceContext serviceContext) {
> System.out.println("Initializing the service context");
> MessageContext msgCtx = MessageContext.getCurrentMessageContext();
> if (msgCtx != null)
> {
> String remoteAddress =(String)msgCtx.getProperty("REMOTE_ADDR");
> System.out.println("remoteAddress - " + remoteAddress);
> }
> }
> ---------------------------
>
> msgCtx is coming as null.
>
>
>
> Regards,
> Geeta Madhurima
> Desk: (212) 723 2505
> -----Original Message-----
> From: Deepal Jayasinghe [mailto:deepalk@gmail.com]
> Sent: 30 June 2011 20:41
> To: java-user@axis.apache.org
> Subject: Re: Identify IP address of the source request
>
> You can get the remote IP address of the client corresponding to the
current message as follows; String remoteAddress =
> String)msgCtx.getProperty("REMOTE_ADDR"):
>
> Deepal
>
> On Thu, Jun 30, 2011 at 3:34 PM, Matta, Geethamadhurima <
geethamadhurima.matta@citi.com> wrote:
>> Hi,
>>
>> I am using Axis2 1.5.1.
>>
>> We need to authenticate if the request coming to Axis2 server is from a
valid source.
>> Can we identify using the ip address of the source.
>> Is there any way to get the ip address of the source from the request?
>>
>> Regards,
>> Geeta Madhurima
>> Desk: (212) 723 2505
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
>
>
>
> --
> http://blogs.deepal.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>

Mime
View raw message