vashishth
vashishth

Reputation: 3370

WSO2 ESB read from a file

I need to perform below two task. First read the content of a file and append those content to response message of service using WSO2 ESB. Second - I need to read a file from a source directory without moving or deleting that file from source directory. Can anybody suggest possible way to perform above operations.

Upvotes: 1

Views: 2939

Answers (2)

vashishth
vashishth

Reputation: 3370

I have created class mediator to do on demand read from a file and its successfully working. First create a class mediator project - a java class that reads the file content and add those to synapse-config body. Put that jar file in ESB_HOME/repository/component/lib restart server and now that class will be available in ESB. :)
Below are the reference tutorials.

http://rajikak.blogspot.in/2010/03/writing-class-mediator-for-wso2-esb-300.html http://www.nuwanbando.com/2013/06/reading-an-xml-file-into-wso2-esb-transform-it-and-expose-it-as-an-api/#more-1009

http://docs.wso2.org/display/ESB470/Places+for+Putting+Custom+Mediators

Upvotes: 1

Ratha
Ratha

Reputation: 9692

You can use VFS transport?

And

the sample http://docs.wso2.org/pages/viewpage.action?pageId=26838852

Upvotes: 1

Related Questions