This sample demonstrates the capabilities of Message Transmission Optimization Mechanism (MTOM). An MTOM Web Service accepts a fileName and a DataHandler. The DataHandler contains the binary content which is eventually saved to a temporary location in a given fileName.
To build the samples you need Apache Ant build tool.
Apache Ant 1.6.2 or higher is needed.
The steps are as follows:
2. In a command prompt, switch to the MTOM directory.
For example, cd <AS_HOME>\samples\MTOM
3. From there, type ant.
The generated service (MTOMSample.aar) gets copied to <AS_HOME>/repository/deployment/server/axis2services automatically. Start the Application Server using <AS_HOME>/bin/wso2server.sh (in Linux) or <AS_HOME>/bin/wso2server.bat (in Windows).
Use the script run-client.sh or run-client.bat file to invoke the client using arguments
For example, ./run-client.sh -file /tmp/wwe.jpg -fileName wresting.jpg
Sometimes, it is necessary to clean the services repository before you generate and deploy the service and run the client. In order to do that, delete services created from previous samples.