I created a proxy service with cxf in mule. My version of mule is 3.3.0 CE. Now, I want to put a restriction in my wsdl that created with proxy service.
My restriction shouldn’t allow to per IP that they see my wsdl.
for this, I find Groovy expression and bellow code:
<expression-filter
expression="#[groovy:'${allowed}'.contains(message.getInboundProperty('MULE_REMOTE_CLIENT_ADDRESS').substring(message.getInboundProperty('MULE_REMOTE_CLIENT_ADDRESS').indexOf('/')+1, message.getInboundProperty('MULE_REMOTE_CLIENT_ADDRESS').indexOf(':')))]"
doc:name="Expression" />
I don’t know Is good code Or no?
and I don’t know where do I should define my valid Ip?
That approach is valid.
Only suggest I would do is to extract the IP parsing to a global function for reusability and better readability:
Then you can use it as follows: