}
// mark as a response and replace envelope from cache
synCtx.setResponse(true);
try {
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage smsg;
if (synCtx.isSOAP11()) {
smsg = mf.createMessage(new MimeHeaders(),
new ByteArrayInputStream(cachedObj.getResponseEnvelope()));
} else {
MimeHeaders mimeHeaders = new MimeHeaders();
mimeHeaders.addHeader("Content-ID", IDGenerator.generateID());
mimeHeaders.addHeader("content-type",
HTTPConstants.MEDIA_TYPE_APPLICATION_SOAP_XML);
smsg = mf.createMessage(mimeHeaders,
new ByteArrayInputStream((cachedObj).getResponseEnvelope()));
}
if (smsg != null) {
org.apache.axiom.soap.SOAPEnvelope omSOAPEnv =