code: protected void setSOAPResponseObject(SOAPMessageContext context,
                                           Object newResponse) {
          if (newResponse == null) {
              return;
          }
          // Extract the SOAP Message
          SOAPMessage message = context.getMessage();
  
          // Get the envelope body
          SOAPElement body;
          try {
              body = message.getSOAPBody();
              SOAPElement response = getSOAPResponseNode(context);
              body.removeChild(response);
              marshall(newResponse, body);
          } catch (SOAPException e) {
              logger.error("Problem changing SOAP message contents", e);
              throw CXFUtility.getFault(e);
          }
      }
docs: Sets the return object for a response as the param.
  
  @param context
  the message context
  @param newResponse
  the object to set as the return object
  @throws SoapFault