try {
Response resp = BetterRPCRouter.invoke(envelope.getHeader(), dd,
call, targetObject, reqContext, resContext);
Envelope env = resp.buildEnvelope();
StringWriter sw = new StringWriter();
env.marshall(sw, call.getSOAPMappingRegistry(), resContext);
resContext.setRootPart(sw.toString(),
Constants.HEADERVAL_CONTENT_TYPE_UTF8);
}
catch(Exception e) {
if (e instanceof SOAPException)
throw (SOAPException )e;
throw new SOAPException(Constants.FAULT_CODE_SERVER, e.toString());
}