[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axis-user
Subject:    RE: Identify IP address of the source request
From:       Nadir Amra <amra () us ! ibm ! com>
Date:       2011-06-30 20:58:36
Message-ID: OF7839161F.1864950D-ON862578BF.007326D8-862578BF.00733993 () us ! ibm ! com
[Download RAW message or body]

--=_alternative 00733993862578BF_=
Content-Type: text/plain; charset="US-ASCII"

How about trying something like:

(String)msgContext.getProperty(MessageContext.REMOTE_ADDR);

Nadir Amra
Integrated Web Services for IBM i Operating System
Internet: amra@us.ibm.com

"Matta, Geethamadhurima " <geethamadhurima.matta@citi.com> wrote on 
06/30/2011 03:52:58 PM:

> From: "Matta, Geethamadhurima " <geethamadhurima.matta@citi.com>
> To: "'java-user@axis.apache.org'" <java-user@axis.apache.org>
> Date: 06/30/2011 03:53 PM
> Subject: RE: Identify IP address of the source request
> 
> 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
> 

--=_alternative 00733993862578BF_=
Content-Type: text/html; charset="US-ASCII"

<font size=2 face="sans-serif">How about trying something like:</font>
<br>
<br><font size=2 face="Courier \
New">(String)msgContext.getProperty(MessageContext.REMOTE_ADDR);</font> <br><font \
size=2 face="sans-serif"><br> Nadir Amra<br>
Integrated Web Services for IBM i Operating System<br>
Internet: amra@us.ibm.com</font>
<br>
<br><tt><font size=2>&quot;Matta, Geethamadhurima &quot; \
&lt;geethamadhurima.matta@citi.com&gt; wrote on 06/30/2011 03:52:58 PM:<br>
<br>
&gt; From: &quot;Matta, Geethamadhurima &quot; \
&lt;geethamadhurima.matta@citi.com&gt;</font></tt> <br><tt><font size=2>&gt; To: \
&quot;'java-user@axis.apache.org'&quot; &lt;java-user@axis.apache.org&gt;</font></tt> \
<br><tt><font size=2>&gt; Date: 06/30/2011 03:53 PM</font></tt> <br><tt><font \
size=2>&gt; Subject: RE: Identify IP address of the source request</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Deepal,<br>
&gt; <br>
&gt; Following is the code:<br>
&gt; ---------------------------<br>
&gt; public void init(ServiceContext serviceContext) {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
System.out.println(&quot;Initializing the service context&quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageContext
msgCtx = <br>
&gt; MessageContext.getCurrentMessageContext();<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (msgCtx
!= null)<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; String remoteAddress =(String)<br>
&gt; msgCtx.getProperty(&quot;REMOTE_ADDR&quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; System.out.println(&quot;remoteAddress - &quot; + <br>
&gt; remoteAddress);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt; ---------------------------<br>
&gt; <br>
&gt; msgCtx is coming as null.<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; Regards,<br>
&gt; Geeta Madhurima<br>
&gt; Desk: (212) 723 2505<br>
&gt; -----Original Message-----<br>
&gt; From: Deepal Jayasinghe [</font></tt><a href=mailto:deepalk@gmail.com><tt><font \
size=2>mailto:deepalk@gmail.com</font></tt></a><tt><font size=2>]<br> &gt; Sent: 30 \
June 2011 20:41<br> &gt; To: java-user@axis.apache.org<br>
&gt; Subject: Re: Identify IP address of the source request<br>
&gt; <br>
&gt; You can get the remote IP address of the client corresponding to the<br>
&gt; current message as follows; String remoteAddress =<br>
&gt; String)msgCtx.getProperty(&quot;REMOTE_ADDR&quot;):<br>
&gt; <br>
&gt; Deepal<br>
&gt; <br>
&gt; On Thu, Jun 30, 2011 at 3:34 PM, Matta, Geethamadhurima <br>
&gt; &lt;geethamadhurima.matta@citi.com&gt; wrote:<br>
&gt; &gt; Hi,<br>
&gt; &gt;<br>
&gt; &gt; I am using Axis2 1.5.1.<br>
&gt; &gt;<br>
&gt; &gt; We need to authenticate if the request coming to Axis2 server
is <br>
&gt; from a valid source.<br>
&gt; &gt; Can we identify using the ip address of the source.<br>
&gt; &gt; Is there any way to get the ip address of the source from the
request?<br>
&gt; &gt;<br>
&gt; &gt; Regards,<br>
&gt; &gt; Geeta Madhurima<br>
&gt; &gt; Desk: (212) 723 2505<br>
&gt; &gt;<br>
&gt; &gt; ---------------------------------------------------------------------<br>
&gt; &gt; To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org<br>
&gt; &gt; For additional commands, e-mail: java-user-help@axis.apache.org<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; --<br>
&gt; </font></tt><a href=http://blogs.deepal.org/><tt><font \
size=2>http://blogs.deepal.org</font></tt></a><tt><font size=2><br> &gt; <br>
&gt; ---------------------------------------------------------------------<br>
&gt; To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org<br>
&gt; For additional commands, e-mail: java-user-help@axis.apache.org<br>
&gt; <br>
&gt; <br>
&gt; ---------------------------------------------------------------------<br>
&gt; To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org<br>
&gt; For additional commands, e-mail: java-user-help@axis.apache.org<br>
&gt; <br>
</font></tt>
--=_alternative 00733993862578BF_=--


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic