[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>"Matta, Geethamadhurima " \
<geethamadhurima.matta@citi.com> wrote on 06/30/2011 03:52:58 PM:<br>
<br>
> From: "Matta, Geethamadhurima " \
<geethamadhurima.matta@citi.com></font></tt> <br><tt><font size=2>> To: \
"'java-user@axis.apache.org'" <java-user@axis.apache.org></font></tt> \
<br><tt><font size=2>> Date: 06/30/2011 03:53 PM</font></tt> <br><tt><font \
size=2>> Subject: RE: Identify IP address of the source request</font></tt>
<br><tt><font size=2>> <br>
> Deepal,<br>
> <br>
> Following is the code:<br>
> ---------------------------<br>
> public void init(ServiceContext serviceContext) {<br>
> \
System.out.println("Initializing the service context");<br>
> MessageContext
msgCtx = <br>
> MessageContext.getCurrentMessageContext();<br>
> if (msgCtx
!= null)<br>
> {<br>
>
String remoteAddress =(String)<br>
> msgCtx.getProperty("REMOTE_ADDR");<br>
>
System.out.println("remoteAddress - " + <br>
> remoteAddress);<br>
> }<br>
> }<br>
> ---------------------------<br>
> <br>
> msgCtx is coming as null.<br>
> <br>
> <br>
> <br>
> Regards,<br>
> Geeta Madhurima<br>
> Desk: (212) 723 2505<br>
> -----Original Message-----<br>
> 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> > Sent: 30 \
June 2011 20:41<br> > To: java-user@axis.apache.org<br>
> Subject: Re: Identify IP address of the source request<br>
> <br>
> You can get the remote IP address of the client corresponding to the<br>
> current message as follows; String remoteAddress =<br>
> String)msgCtx.getProperty("REMOTE_ADDR"):<br>
> <br>
> Deepal<br>
> <br>
> On Thu, Jun 30, 2011 at 3:34 PM, Matta, Geethamadhurima <br>
> <geethamadhurima.matta@citi.com> wrote:<br>
> > Hi,<br>
> ><br>
> > I am using Axis2 1.5.1.<br>
> ><br>
> > We need to authenticate if the request coming to Axis2 server
is <br>
> from a valid source.<br>
> > Can we identify using the ip address of the source.<br>
> > Is there any way to get the ip address of the source from the
request?<br>
> ><br>
> > Regards,<br>
> > Geeta Madhurima<br>
> > Desk: (212) 723 2505<br>
> ><br>
> > ---------------------------------------------------------------------<br>
> > To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org<br>
> > For additional commands, e-mail: java-user-help@axis.apache.org<br>
> ><br>
> ><br>
> <br>
> <br>
> <br>
> --<br>
> </font></tt><a href=http://blogs.deepal.org/><tt><font \
size=2>http://blogs.deepal.org</font></tt></a><tt><font size=2><br> > <br>
> ---------------------------------------------------------------------<br>
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org<br>
> For additional commands, e-mail: java-user-help@axis.apache.org<br>
> <br>
> <br>
> ---------------------------------------------------------------------<br>
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org<br>
> For additional commands, e-mail: java-user-help@axis.apache.org<br>
> <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