All you need to do is to get a copy of the commons-net_3.3.0.wso2v1.jar from a ESB 4.9.0 pack which could be found on
Create a file and add a text value to it. Here we added below text value to the text file.
hello ShadshaCreate a pass-through proxy service in ESB. Please find the proxy configuration below: (As the source path specify the path to the above created text file)
<?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="testProxy" transports="https http" startOnLoad="true" trace="disable"> <description/> <target> <inSequence> <fileconnector.read> <source>/home/ubuntu/Desktop/file/file1.txt</source> <contentType>text/plain</contentType> <encoding>utf-16le</encoding> </fileconnector.read> <log level="full"/> <respond/> </inSequence> </target> </proxy>
Send a request to the proxy service and you will be able to see the logs as below:
[2017-04-11 16:30:37,677] INFO - LogMediator To: /services/Proxy1, WSAction: urn:mediate, SOAPAction: urn:mediate, MessageID: urn:uuid:6680285b-32e6-4d23-887f-22b65f5ea002, Direction: request, Envelope: <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><text xmlns="http://ws.apache.org/commons/ns/payload">hello Shadsha</text></soapenv:Body></soapenv:Envelope>
No comments:
Post a Comment