Thursday, November 24, 2011

Retriving clientIP/Host within the sequence in Synapse

<property name="client-host" expression="get-property('axis2', 'REMOTE_HOST')"/>         
<property name="client-add" expression="get-property('axis2', 'REMOTE_ADDR')"/>
<log level="custom">    
    <property name="REMOTE_ADDR :" expression="get-property('client-add')"/>

    <property name="REMOTE_HOST:" expression="get-property('client-host')"/>
</log>

2 comments:

  1. Will it work through proxy server as well? Or do we have any X-Forwarded-For property support?

    ReplyDelete
  2. We have x-forwarded-for support.Try like this;
    <log>
    <property name="xforward-header" expression="$trp:X-Forwarded-For"/>
    </log>

    ReplyDelete