String charset = msgOptions.getEncoding().toString();
String outtype = msgOptions.getOutMediaTypeCode();
String[] intypes = msgOptions.getInMediaTypeCodes();
MessageProperties props = new MessageProperties();
props.setContentType(getMediaTypeMapper().getMediaTypeFor(outtype));
MediaType[] acceptTypes = new MediaType[intypes.length];
for (int i = 0; i < intypes.length; i++) {
acceptTypes[i] = getMediaTypeMapper().getMediaTypeFor(intypes[i]);
}
props.setAcceptTypes(acceptTypes);
if (m_soapVersion.equals(SoapVersion.SOAP1_1)) {
String soapAction;
if (opname == null) {
soapAction = ""; // No value means that there is no indication of the intent of the message.
} else {
soapAction = "\"" + opname + "\"";
}
props.setProperty(SOAPACTION_HEADER, soapAction);
// } else if (m_soapVersion.equals(SoapVersion.SOAP1_2)) {
// if (opname != null && opname.length() > 0) {
// props.setOperation(opname);
// }
} else {
throw new IllegalStateException("Internal error - unsupported SOAP version " + m_soapVersion);
}
if (charset != null) {
props.setCharset(charset);
}
return props;
}