buf.append(HTTPConstants.HEADER_CONTENT_TYPE).append(": ").append(SOAP12Constants.SOAP_12_CONTENT_TYPE);
buf.append("; charset=utf-8\n");
} else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) {
buf.append(HTTPConstants.HEADER_CONTENT_TYPE).append(": text/xml; charset=utf-8\n");
}else {
throw new AxisFault("Unknown SOAP Version. Current Axis handles only SOAP 1.1 and SOAP 1.2 messages");
}
}
buf.append(HTTPConstants.HEADER_ACCEPT).append(": application/soap+xml, application/dime, multipart/related, text/*\n");
buf.append(HTTPConstants.HEADER_HOST).append(": ").append(url.getHost()).append("\n");
buf.append(HTTPConstants.HEADER_CACHE_CONTROL).append(": no-cache\n");
buf.append(HTTPConstants.HEADER_PRAGMA).append(": no-cache\n");
if (chuncked) {
buf
.append(HTTPConstants.HEADER_TRANSFER_ENCODING)
.append(": ")
.append(HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED)
.append("\n");
}
if(!chuncked && !msgContext.isDoingMTOM()) {
buf.append(HTTPConstants.HEADER_CONTENT_LENGTH).append(": " + contentLength + "\n");
}
if (!msgContext.isDoingREST()) {
buf.append("SOAPAction: \"" + soapActionString + "\"\n");
}
buf.append("\n");
out.write(buf.toString().getBytes());
} catch (IOException e) {
throw new AxisFault(e);
}
}