@SuppressWarnings("unchecked")
public void updateHeaders(MessageContext ctx, SOAPMessage msg) throws SOAPException {
if (msg.saveRequired()) {
msg.saveChanges();
}
MimeHeaders headers = msg.getMimeHeaders();
Map<String, List<String>> reqHead;
String inOutKey = MessageContext.HTTP_REQUEST_HEADERS;
if (isServer) {
inOutKey = MessageContext.HTTP_RESPONSE_HEADERS;
}
reqHead = (Map<String, List<String>>)ctx.get(inOutKey);
if (reqHead == null) {
reqHead = new HashMap<String, List<String>>();
ctx.put(inOutKey, reqHead);
}
Iterator it = headers.getAllHeaders();
while (it.hasNext()) {
MimeHeader header = (MimeHeader)it.next();
if (!"Content-Length".equals(header.getName())) {
List<String> vals = reqHead.get(header.getName());
if (null == vals) {