1. Run 'ant' command in 'wso2esb-4.0.3\samples\axis2Server\src\SimpleStockQuoteService'

2. Start axis2server in ESB from 'wso2esb-4.0.3\samples\axis2Server\axis2server.bat'

3. Start ESB from 'wso2esb-4.0.3\bin\wso2server.bat'

Now Create Proxy for test Log mediator in WSO2 ESB (4.0.3)

4. Fill Fields as Below

WSO2 ESB proxy


Then You will Find proxy we create on 'Web Services'-->'List'-->'LogMediatorTest'

5. Go to 'LogMediatorTest' and click on 'Edit' in ‘Specific Configuration’

WSO2 ESB proxy details page

6. Then go to 'Step 2 of 3 - In Sequence and Endpoint Options' by click on Next button

7. Click Define Inline (Radio Button) and click on 'Create'

WSO2 ESB proxy in sequence page

8. Add ‘Log’

WSO2 ESB proxy for log

9. Change the Log level to ‘Full’ and update

WSO2 ESB proxy for full log

Source view

<log xmlns="http://ws.apache.org/ns/synapse" level="full" />

10. Then ‘Apply’ and ‘save’

Finish the editing by ‘next’ and ‘Finish’

11. Enter 'ant' in '\wso2esb-4.0.3\samples\axis2Client' to build clients

12. Then Enter 'ant stockquote -Dtrpurl=http://localhost:8280/services/LogMediatorTest -Dsymbol=IBM' in Client.

WSO2 ESB proxy client

Here is log from ESB

WSO2 ESB log console in windows 7

Here is the Envelope Body of the log.

<soapenv:Body>
<m0:getQuote xmlns:m0="http://services.samples">
<m0:request>
<m0:symbol>IBM</m0:symbol>
</m0:request>
</m0:getQuote>
</soapenv:Body>

Now I need log only the symbol.

b. Now we will create 'Custom' log

b1. Now we update 'properties of the Log mediator'

'//m0:getQuote/m0:request/m0:symbol' in Expression 

WSO2 ESB log mediator

Adding name space for custom log. (Click ‘save’ to save)

esb name space

'm0' as Prefix
'http://services.samples' as URI

To Test this Run the client again

‘ant stockquote -Dtrpurl=http://localhost:8280/services/LogMediatorTest -Dsymbol=IBM’

Here is console log of the esb

WSO2 ESB log mediator console in windows 7

Ok, work is success.

 

 

 

 

Add ‘//m0:getQuote/m0:request/m0:symbol’ as

 

 

 

 

image

0

Add a comment

I am
I am
Archives
Total Pageviews
Total Pageviews
2 0 5 7 7 0 6
Categories
Categories
Loading