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? :)
> 

Reply via email to