• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to convert incoming Multipart to base64binary

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following problem. My webservice is a two-way inteface. From one side it is a REST interface which takes a POST method that accepts a MultiPart message (it is a audio file). Now I need to send this file again to another server with a SOAP interface as a base64binary attachment. I tried to this like this:

But this doesn't work (the server does not recognize the file and when i try to save it it's size is 0kb. I found a way to overcome this- I first save the multipart message to HDD and read it again with :

However this is a little bit dull first to save the file and read it again from the HDD. Does any one have another idea on how to convert more 'directly' the MultiPart to Base64binary DataHandler?
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Have you tried creating the DataHandler instance with an additional argument specifying the mime type of the data?
For additional information, see the DataHandler API documentation and the second constructor.
Best wishes!
 
Adam Kronicki
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help but this does not solve the problem however the error message is different. Before the error was(shoudl have postet that before):

And After adding the MIME type("audio/x-wav") the error is:
 
That's my roommate. He's kinda weird, but he always pays his half of the rent. And he gave me this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic