This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SAAJ - adding an attachment to a reply in the servlet getting exception on client  RSS feed

dan pudwell
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm fairly new to saaj and web services, any help appreciated.
I'm working on sending a binary file through a web service. My client can send the file just fine but when the servlet tries to add an attachment to the response it blows up. I get a SAAJ exception about the content type:
ERROR: 'Content is not allowed in prolog.'
24-Oct-2012 13:59:28 com.sun.xml.internal.messaging.saaj.soap.EnvelopeFactory createEnvelope
SEVERE: SAAJ0511: Unable to create envelope from given source
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:

I think its to do with the headers on the response but not sure how to set these. Do these have to be set differently from when you are adding the attachment on a request? Any examples of a servlet that adds soap attachments would be very handy please.

here is my client code:

and here is my server code:
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!