Return-Path: Delivered-To: apmail-ws-axis-c-user-archive@www.apache.org Received: (qmail 25532 invoked from network); 3 Aug 2009 12:47:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Aug 2009 12:47:28 -0000 Received: (qmail 43560 invoked by uid 500); 3 Aug 2009 12:47:32 -0000 Delivered-To: apmail-ws-axis-c-user-archive@ws.apache.org Received: (qmail 43522 invoked by uid 500); 3 Aug 2009 12:47:32 -0000 Mailing-List: contact axis-c-user-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C User List" Reply-To: "Apache AXIS C User List" Delivered-To: mailing list axis-c-user@ws.apache.org Received: (qmail 43513 invoked by uid 99); 3 Aug 2009 12:47:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Aug 2009 12:47:32 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ahsan.nabeel@gmail.com designates 209.85.217.215 as permitted sender) Received: from [209.85.217.215] (HELO mail-gx0-f215.google.com) (209.85.217.215) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Aug 2009 12:47:24 +0000 Received: by gxk11 with SMTP id 11so5573112gxk.16 for ; Mon, 03 Aug 2009 05:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=2G6Ylvp+lu2dhD/z800+FVEsKvM9UX4XT2zmuX2vjkc=; b=JzkXCqpAARIk1wNxD2Zbmm44ry1LRzeWfN97Y0Ae4BXVVqVOTRfpMfZW1NNXj1LWwQ PNwqbVa+Gp4H45RxTi9AoOQmixWU3iEI5AmXFXkVNhhJ0urnnQW72FCKbkhrFvDsGEPd I3T58x+XNcIVypxCMeEXlPyqMv1HJt5FaVjjw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=oJ1U9vqD43rS+z9yGXEWPs0DPbpiynKj2rZdvYVzF08CobYFMqVGmTE7jPP1MyQPQC 8WJaVWSYskfsI0Ht8DKsQnlFOf2ne5jJU7pptZIsl4zEfX79fefPf3qOzEZxdOnesWUd pYNMtEtVCm0MUyOXd78qRswEPPvag/fij2Jzo= MIME-Version: 1.0 Received: by 10.100.31.4 with SMTP id e4mr7962529ane.191.1249303623736; Mon, 03 Aug 2009 05:47:03 -0700 (PDT) In-Reply-To: <8d38ca0a0907100448r3da0f65pb0d4d6e5bb459f43@mail.gmail.com> References: <200907091840.46608.shristov@gcn.bg> <200907101410.50327.shristov@gcn.bg> <8d38ca0a0907100448r3da0f65pb0d4d6e5bb459f43@mail.gmail.com> Date: Mon, 3 Aug 2009 17:47:03 +0500 Message-ID: <237885030908030547i73326dn85ce77ce2465f85a@mail.gmail.com> Subject: Re: Obtaining consumer address from Axis2/C service - SOLVED From: Nabeel Naseem Ahsan To: Apache AXIS C User List Content-Type: multipart/alternative; boundary=0016e644cf0eb59e0904703c2a85 X-Virus-Checked: Checked by ClamAV on apache.org --0016e644cf0eb59e0904703c2a85 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I tried using this property with axis2 1.5.0, but i got an segmentation fault. Can anyone help me out? Nabeel Ahsan On Fri, Jul 10, 2009 at 4:48 PM, Sam Carleton wrote: > Thank you for posting the answer, this could be very useful! > > On Fri, Jul 10, 2009 at 7:10 AM, Stefan Hristov wrote: > >> Well, looking at the source usually helps :) >> >> There is a property in msg_ctx called AXIS2_SVR_PEER_IP_ADDR which >> contains the remote peer IP address. >> So basically this is how one could get the web-service consumer IP >> address: >> >> axutil_property_t *peer = axis2_msg_ctx_get_property >> (msg_ctx, env, AXIS2_SVR_PEER_IP_ADDR); >> char *remote_ip = (char *) axutil_property_get_value (peer, >> env); >> AXIS2_LOG_INFO (env->log, "Got a call from %s", remote_ip); >> >> On Thursday 09 July 2009 18:40:46 Stefan Hristov wrote: >> > Hi all, >> > >> > I am writing a web-service using Axis2/C v1.6.0. The service is deployed >> with Apache2 mod-axis2.so. >> > >> > I need to get the sender IP address (or anything which can be used to >> identify the consumer) when my service is called (meaning, in >> axis2_svc_skel_XXX_invoke function). >> > >> > I have searched through the API documentation using axis2_msg_ctx_t as a >> reference (the startup data I have in invoke function), but unfortunately >> the functions I've found return my own address (the full URL, actually), not >> senders. I mean axis2_msg_ctx_get_from and axis2_options_get_from, both >> yielding axis2_endpoint_ref_t type. There are few similar other functions, >> but they all are returning NULL. >> > >> > Any suggestions or pointers, please? :) >> > >> > > --0016e644cf0eb59e0904703c2a85 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I tried using this property with axis2 1.5.0, but i got an segmentation fau= lt. Can anyone help me out?

Nabeel Ahsan

On Fri, Jul 10, 2009 at 4:48 PM, Sam Carleton <= scarleton@gmail.com> w= rote:
Thank you for pos= ting the answer, this could be very useful!

On Fri, Jul 10, 2009 at 7:10 AM, Stefan Hristov <shristov@gcn.bg> wrote:
Well, looking at = the source usually helps :)

There is a property in msg_ctx called AXIS2_SVR_PEER_IP_ADDR which contains= the remote peer IP address.
So basically this is how one could get the web-service consumer IP address:=

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0axutil_property_t *peer =3D axis2_msg_ctx_g= et_property (msg_ctx, env, AXIS2_SVR_PEER_IP_ADDR);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0char *remote_ip =3D (char *) axutil_propert= y_get_value (peer, env);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AXIS2_LOG_INFO (env->log, "Got a ca= ll from %s", remote_ip);

On Thursday 09 July 2009 18:40:46 Stefan Hristov wrote:
> Hi all,
>
> I am writing a web-service using Axis2/C v1.6.0. The service is deploy= ed with Apache2 mod-axis2.so.
>
> I need to get the sender IP address (or anything which can be used to = identify the consumer) when my service is called (meaning, in axis2_svc_ske= l_XXX_invoke function).
>
> I have searched through the API documentation using axis2_msg_ctx_t as= a reference (the startup data I have in invoke function), but unfortunatel= y the functions I've found return my own address (the full URL, actuall= y), not senders. I mean axis2_msg_ctx_get_from and axis2_options_get_from, = both yielding axis2_endpoint_ref_t type. There are few similar other functi= ons, but they all are returning NULL.
>
> Any suggestions or pointers, please? :)
>


--0016e644cf0eb59e0904703c2a85--