I am trying to implement a web service in Java to receive a file from my client application which is implemented in .Net. But, I am unable to implement the Java web service. I tried a lot to get any example program. But, I didn’t get it.
My main objectives is:
- I will browse and send a file using my .Net client software
- My Java web service will be able to receive that file
- After receiving that file, I will do some processing using that file and generate a new file.
- Now, I will have to return that new file to my .Net client again
Simply,
Input: My web method will have to receive a file
Output: My web method should return a file
Below are my local environment details:
Apache Tomcat 7, Axis 2, Eclipse, JRE 6
Can anybody help me how to write that web method in my Java web service?
You can send/receive files as base64 encoded data contained within the XML document or as attachments contained outside the XML document (MTOM).
In wsdl first approach you need to use schema type “base64Binary”.
In code first approach you can write:
Links: