So for work, i have to write a .Net web service along with an Axis2 client which will consume the web service. One of the requirement for the project is that they have to have the ability to transfer data with each other using MTOM. The whole project/idea seem fun and easy enough. Since I’ve never used/programmed with Axis before, I wanted to start with a very simple web service and client (hello world, echo). After having my environment set up, I went on with the code. I quickly wrote up the web service and client and everything worked as expected. I then moved on to MTOM portion of the code. I changed the web service to a simple file transfer service (download/upload) using MTOM (WSE3). Then, i wrote up the client portion of the code. Things seemed to go very smoothly but when I tried to test the code, I kept on getting 400: Bad Request response and Axis Fault exception from my client code. Thinking that i probably made a mistake in my code, I went through the code again and again. However, i can’t see what cause the issue. Google search on the exception and it seemd that some people also has similar issue/exception so i tried to use their method to debug:
- Use TCPMON/HTTPAnalyzer to check the header and content of the SOAP message : everything is good! (checked)
- Client stub are generated using WSDL2JAVA using :
+ XMLBeans (checked)
+ADB (checked)
- Create the SOAP message using AXIOM and (checked)
The issue was still there and I still didn’t know what the heck was wrong. So then I was thinking that probably something wrong with my .NET web service. I decided to write a C# client instead. However, with the C# client, everything worked perfectly. I was able to transfer (upload/download files) to/from the web service. The whole day went by and i still didn’t know what was wrong and how to fix it.
The next day, I took a look again at the SOAP message header and compare them between C# client and AXIS2 Java client. By then, I noticed that the “start” attribute for the java client doesn’t match with the “content-id” and it’s also missing a “<” . So on to the Google search “.NET web service, AXIS2, MTOM, start missing <” and the first search result lead me to this link which then lead me to this AXIS2 1.3 BUG 3196. Follow the solution, i replace the Axiom-api jar with the latest one and everything work as expected.
I don’t understand how this issue was found and fixed in early Oct, 2007 and the fixed is still not in the distributed zip file on Axis website. If it was updated, it would save me and probably many others who are new to AXIS/AXIS2 a lot of trouble debug and research for solution.