File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MTOM not working in Axis2

 
Anjali S Sharma
Ranch Hand
Posts: 279
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to transfer content using MTOM (in Axis2). For this I have added the following entry to services.xml



In the client, I am doing the following



In the service, I am doing the following



The content transfers fine, but when I access the SOAP response, it shows the following



It seems that MTOM setting is not having any effect.
Pleae let me know if I am missing something in order to enable MTOM.

Thank you
 
shivendra tripathi
Ranch Hand
Posts: 263
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have noticed your wsdl which says


So if you have given content type as base64Binary then you should be getting base64 encoded data and you are getting that. I don't see any problem.
 
Anjali S Sharma
Ranch Hand
Posts: 279
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is still MTOM getting used?
Actually we will be transferring huge files (50-100MB) using this service. So need to use MTOM for content transfer.

I have read that transferring binary data as payload increases the size three times. So don't want to do that.

Thank you
 
shivendra tripathi
Ranch Hand
Posts: 263
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct it seems like mtom is not engaged. Can you post your code (service/client) where you are trying to enable mtom?
 
shivendra tripathi
Ranch Hand
Posts: 263
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried it my self and got MTOM enabled at server side. Here is my service skeleton code.


and service.xml


Options I used to generate skeleton


SOAP response


 
Anjali S Sharma
Ranch Hand
Posts: 279
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can't find it any different from what I have done.
Can you please post the client as well?

thank you
 
shivendra tripathi
Ranch Hand
Posts: 263
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used soap UI. To figure out if problem is with client, use soap UI with your service. But my presumption is problem should not be in client side.
 
Anjali S Sharma
Ranch Hand
Posts: 279
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tried with soapUI but with the same result.
Also, set the property

<parameter name="enableMTOM">true</parameter>

in axis2.xml in the Service.
Earlier it was there in services.xml only.
 
shivendra tripathi
Ranch Hand
Posts: 263
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you restarted your server after making changes to parameter in services.xml?
 
Anjali S Sharma
Ranch Hand
Posts: 279
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I restarted the server.

MTOM example that you tried was it contract first or code first? It seems code first MTOM is working but when using contract first approach, MTOM classes are not getting generated by the eclipse plugin or WSDL2Java
 
shivendra tripathi
Ranch Hand
Posts: 263
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's contact first. Can you post your generated response object code? I am interested to see following method
.
 
Anjali S Sharma
Ranch Hand
Posts: 279
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shivendra tripathi wrote:It's contact first. Can you post your generated response object code? I am interested to see following method
.


Thanks for replyng.

Here is the setContent method



and here is the complete class


 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic