Thanks Dan, turning on MTOM worked fine. Colm.
-----Original Message----- From: Daniel Kulp [mailto:[email protected]] Sent: 11 December 2008 22:04 To: Colm O hEigeartaigh Cc: [email protected] Subject: Re: Getting attachments from the SOAP message context Colm, Can you try turning on MTOM for the service and seeing if that changes anything? I THINK what is going on is that the AttachmentOutInterceptor (that runs before everything else) is not seeing that any attachments are needed so it doesn't setup the mime headers and boundaries and such and then isn't adding the AttachmentWriter stuff to the chain. I think if you turn on MTOM, then it should set that stuff up and the attachments would go through. Dan On Thursday 11 December 2008 11:34:10 am Colm O hEigeartaigh wrote: > Thanks Dan. I have another question on the outbound side. I have a > SOAPHandler<SOAPMessageContext> implementation which adds an attachment > (gif) to the message roughly like so: > > SOAPMessage soapMessage = smc.getMessage(); > > javax.xml.soap.AttachmentPart attachment; > InputStream input = ... > byte[] data = new byte[input.available()]; > input.read(data); > attachment = soapMessage.createAttachmentPart(); > attachment.setRawContentBytes(data, 0, data.length, "image/gif"); > attachment.setMimeHeader("Content-Transfer-Encoding", "binary"); > soapMessage.addAttachmentPart(attachment); > > soapMessage.saveChanges(); > > This works fine with the latest snapshot of 2.0.x, I can see the > LoggingFeature printing out the attachment in the outbound message. > However when I try with 2.1.x, it doesn't appear to add the attachment > to the outbound message, but no exceptions are thrown. > > Anything obvious I'm doing wrong here? > > Colm. > > > > > -----Original Message----- > From: Daniel Kulp [mailto:[email protected]] > Sent: 09 December 2008 17:16 > To: [email protected] > Cc: Colm O hEigeartaigh > Subject: Re: Getting attachments from the SOAP message context > > > There is the JAXWS standard: > > Map<String, DataHandler> atts = > dataHandlerscontext.get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS); > > > Dan > > On Tuesday 09 December 2008 12:11:06 pm Colm O hEigeartaigh wrote: > > Hi guys, > > > > How do I get inbound attachments from the SOAPMessageContext in a > > SOAPHandler? Something like this used to work: > > > > Object[] attachments = > > ((SOAPMessageContextImpl)context).getWrappedMessage().getAttachments().t > > > oArray(); > > > > Thanks, > > > > Colm. -- Daniel Kulp [email protected] http://dankulp.com/blog
