postMethod.setRequestHeader("SOAPAction", getQuotedSoapAction());
}
OutMessage message = getMessage();
boolean mtomEnabled = Boolean.valueOf((String) context.getContextualProperty(SoapConstants.MTOM_ENABLED)).booleanValue();
Attachments atts = message.getAttachments();
if (mtomEnabled || atts != null)
{
if (atts == null)
{
atts = new JavaMailAttachments();
message.setAttachments(atts);
}
source = new OutMessageDataSource(context, message);
DataHandler soapHandler = new DataHandler(source);
atts.setSoapContentType(HttpChannel.getSoapMimeType(message, false));
atts.setSoapMessage(new SimpleAttachment(source.getName(), soapHandler));
postMethod.setRequestHeader("Content-Type", atts.getContentType());
}
else
{
postMethod.setRequestHeader("Content-Type", HttpChannel.getSoapMimeType(getMessage(), true));
}