}
}
@Override
public void setSoapAction(String soapAction) {
MimeHeaders mimeHeaders = getSaajMessage().getMimeHeaders();
soapAction = SoapUtils.escapeAction(soapAction);
if (SoapVersion.SOAP_11 == getVersion()) {
mimeHeaders.setHeader(TransportConstants.HEADER_SOAP_ACTION, soapAction);
}
else if (SoapVersion.SOAP_12 == getVersion()) {
// force save of Content Type header
try {
saajMessage.saveChanges();
}
catch (SOAPException ex) {
throw new SaajSoapMessageException("Could not save message", ex);
}
String[] contentTypes = mimeHeaders.getHeader(TransportConstants.HEADER_CONTENT_TYPE);
String contentType = !ObjectUtils.isEmpty(contentTypes) ? contentTypes[0] : getVersion().getContentType();
contentType = SoapUtils.setActionInContentType(contentType, soapAction);
mimeHeaders.setHeader(TransportConstants.HEADER_CONTENT_TYPE, contentType);
mimeHeaders.removeHeader(TransportConstants.HEADER_SOAP_ACTION);
}
else {
throw new IllegalStateException("Unsupported SOAP version: " + getVersion());
}