StaxSource createdSource = null;
checkError();
try {
if (obj instanceof SOAPMessage) {
SOAPMessage msg = (SOAPMessage)obj;
if (msg.countAttachments() > 0) {
client.getRequestContext().put(AttachmentOutInterceptor.WRITE_ATTACHMENTS, Boolean.TRUE);
}
} else if (context != null) {
Boolean unwrapProperty = obj instanceof JAXBElement ? Boolean.FALSE : Boolean.TRUE;
getRequestContext().put("unwrap.jaxb.element", unwrapProperty);