• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Client for MTOM content transfer in Axis2

 
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Won't you be my neighbor? - Fred Rogers. tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic