try {
Attachments atts = new JavaMailAttachments(in, ct);
</BUG>
InputStream msgIs = atts.getSoapMessage().getDataHandler().getInputStream();
<BUG>inMessage = new InMessage(STAXUtils.createXMLStreamReader(msgIs, message
.getEncoding(), context), getUri());
</BUG>
inMessage.setAttachments(atts);
}
<BUG>catch (MessagingException e) {
throw new IOException(e.getMessage());</BUG>
}

InMessage inMessage;
String contentType = sp.getStringProperty(HttpConstants.HEADER_CONTENT_TYPE, "text/xml");
InputStream in = result.getInputStream();
if (contentType.toLowerCase().indexOf("multipart/related") != -1)
{
try
{
Attachments atts = new JavaMailAttachments(in, contentType);
InputStream msgIs = atts.getSoapMessage().getDataHandler().getInputStream();
inMessage = new InMessage(STAXUtils.createXMLStreamReader(msgIs,
message.getEncoding(), context), getUri());
inMessage.setAttachments(atts);
