Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client for MTOM content transfer in Axis2

 
Anjali S Sharma
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a webservice in Axis2 from which I need to download content (pdf files).

I have written the following for the client ( from http://ws.apache.org/axis2/1_5_1/mtom-guide.html)



but I am getting these error

1. The method setOptions(Options) is undefined for the type ResumeClient

2. Constants cannot be resolved

I checked the class "org.apache.axis2.Constants.Configuration" but "FORCE_MIME" was not a field there.

Please let me know which class to import and how to set the options.

Thank you


 
shivendra tripathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Regarding 1 > Does ResumeClient extends ServiceClient
Regarding 2> You are right FORCE_MIME doesn't exist. But this will be applicable by default if MTOM is enabled. User guide needs to be updated.
 
Anjali S Sharma
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shivendra tripathi wrote: Does ResumeClient extends ServiceClient


No, it doesn't. Should clients extend ServiceClient?
 
Anjali S Sharma
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed the method to



Is this the right way of doing it? In this I have no where specified where to save the document...
Thank you
 
shivendra tripathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If depends on the service the way it sends attachment. If it send as SWA/MTOM then you have to get hold of envelope and fetch it. But if it is simple mime/multipart then you have to take attachment part out from the response.
 
Anjali S Sharma
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shivendra tripathi wrote:If depends on the service the way it sends attachment. If it send as SWA/MTOM then you have to get hold of envelope and fetch it. But if it is simple mime/multipart then you have to take attachment part out from the response.


I intend to use MTOM. So what is the correct way in that case?

Thank you
 
shivendra tripathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to get hold of soap envelope where it will be having reference to attachment. You can get soap envelope from MessageContext, there can be some MTOM specific API to get hold on attachment which I am not aware.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic