}
soapMessage.saveChanges();
Iterator<MimeHeader> smh = CastUtils.cast(soapMessage.getMimeHeaders().getAllHeaders());
while (smh.hasNext()) {
MimeHeader head = smh.next();
if ("Content-Type".equals(head.getName())) {
message.put(Message.CONTENT_TYPE, head.getValue());
} else if (!"Content-Length".equals(head.getName())) {
if (!heads.containsKey(head.getName())) {
heads.put(head.getName(), new ArrayList<String>());
}
List<String>l = heads.get(head.getName());
l.add(head.getValue());
}
}
OutputStream os = message.getContent(OutputStream.class);
soapMessage.writeTo(os);
os.flush();