Return-Path: X-Original-To: apmail-axis-java-user-archive@www.apache.org Delivered-To: apmail-axis-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C2D2B61E5 for ; Sat, 2 Jul 2011 02:05:09 +0000 (UTC) Received: (qmail 67568 invoked by uid 500); 2 Jul 2011 02:05:08 -0000 Delivered-To: apmail-axis-java-user-archive@axis.apache.org Received: (qmail 67425 invoked by uid 500); 2 Jul 2011 02:05:07 -0000 Mailing-List: contact java-user-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@axis.apache.org Delivered-To: mailing list java-user@axis.apache.org Received: (qmail 67417 invoked by uid 99); 2 Jul 2011 02:05:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jul 2011 02:05:06 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of afkham@gmail.com designates 74.125.82.51 as permitted sender) Received: from [74.125.82.51] (HELO mail-ww0-f51.google.com) (74.125.82.51) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jul 2011 02:05:02 +0000 Received: by wwj26 with SMTP id 26so2922756wwj.32 for ; Fri, 01 Jul 2011 19:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=93GQWAVOspgC3br4h+WdS5WAb5GZgKAAvKqNIS1qX2g=; b=E0Q/zoP4E40QQcNSZdalJkFNjFVGIkqupMD7V0YDWfAaTBizOuaQylextcxHdJiYOX qQbi9cdJg94WEENq52efclLs3aHHcNiD9wDDUSw9Vxmm0d/xlhFfUts4guEZ/LUegBQo +mkRhPkBUWzlHEPhDIO5S9DnU54RBLrG1H63U= MIME-Version: 1.0 Received: by 10.216.235.207 with SMTP id u57mr3482441weq.42.1309572280603; Fri, 01 Jul 2011 19:04:40 -0700 (PDT) Received: by 10.216.27.84 with HTTP; Fri, 1 Jul 2011 19:04:40 -0700 (PDT) Received: by 10.216.27.84 with HTTP; Fri, 1 Jul 2011 19:04:40 -0700 (PDT) In-Reply-To: <2AAC8B004D31D043A4309D2FE18F475A01AD29B638@exlnmb07.eur.nsroot.net> References: <2AAC8B004D31D043A4309D2FE18F475A01AD29B615@exlnmb07.eur.nsroot.net> <2AAC8B004D31D043A4309D2FE18F475A01AD29B638@exlnmb07.eur.nsroot.net> Date: Sat, 2 Jul 2011 07:34:40 +0530 Message-ID: Subject: RE: Identify IP address of the source request From: Afkham Azeez To: java-user@axis.apache.org Content-Type: multipart/alternative; boundary=000e0cd47cec97d2a404a70c8e5f --000e0cd47cec97d2a404a70c8e5f Content-Type: text/plain; charset=ISO-8859-1 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 > --000e0cd47cec97d2a404a70c8e5f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

The MessageContext is set as a thread local variable when a request is r= eceived. 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 operati= on implementation methods.

On Jul 1, 2011 2:23 AM, "Matta, Geethamadhu= rima" <geethamadh= urima.matta@citi.com> wrote:
> Deepal, >
> Following is the code:
> ---------------------------> public void init(ServiceContext serviceContext) {
> = System.out.println("Initializing the service context");
> MessageContext msgCtx =3D MessageContext.getCurrentMes= sageContext();
> if (msgCtx !=3D null)
> = {
> String remoteAddress =3D(String= )msgCtx.getProperty("REMOTE_ADDR");
> System.out.println("remoteAddress - "= ; + remoteAddress);
> }
> }
> ---= ------------------------
>
> msgCtx is coming as null.
>
>
>
> Regards,
> Geeta Madhurima
> De= sk: (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 ad= dress of the client corresponding to the current message as follows; String= remoteAddress =3D
> String)msgCtx.getProperty("REMOTE_ADDR"):
>
> D= eepal
>
> On Thu, Jun 30, 2011 at 3:34 PM, Matta, Geethamadhur= ima <geethamadhurima.m= atta@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 th= e source.
>> Is there any way to get the ip address of the source from the requ= est?
>>
>> Regards,
>> Geeta Madhurima
>&g= t; Desk: (212) 723 2505
>>
>> ---------------------------= ------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For ad= ditional 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
>
--000e0cd47cec97d2a404a70c8e5f--