ArrayList outs) throws Exception
{
String methodName = operation.getName();
/* Now put the result in the result SOAPEnvelope */
RPCElement resBody = new RPCElement(methodName + "Response");
resBody.setPrefix(body.getPrefix());
resBody.setNamespaceURI(body.getNamespaceURI());
resBody.setEncodingStyle(msgContext.getEncodingStyle());
try
{
// Return first
if (operation.getMethod().getReturnType() != Void.TYPE)
{
QName returnQName = operation.getReturnQName();
if (returnQName == null)
{
String nsp = body.getNamespaceURI();
if (nsp == null || nsp.length() == 0)
{
nsp = serviceDesc.getDefaultNamespace();
}
returnQName = new QName(msgContext.isEncoded() ? "" : nsp, methodName + "Return");
}
RPCParam param = new RPCParam(returnQName, objRes);
param.setParamDesc(operation.getReturnParamDesc());
if (!operation.isReturnHeader())
{
// For SOAP 1.2 rpc style, add a result
if (msgContext.getSOAPConstants() == SOAPConstants.SOAP12_CONSTANTS
&& (serviceDesc.getStyle().equals(Style.RPC)))
{
RPCParam resultParam = new RPCParam(Constants.QNAME_RPC_RESULT, returnQName);
resultParam.setXSITypeGeneration(Boolean.FALSE);
resBody.addParam(resultParam);
}
resBody.addParam(param);
}
else
{
resEnv.addHeader(new RPCHeaderParam(param));
}
}
// Then any other out params
if (!outs.isEmpty())
{
for (Iterator i = outs.iterator(); i.hasNext();)
{
// We know this has a holder, so just unwrap the value
RPCParam param = (RPCParam)i.next();
Holder holder = (Holder)param.getObjectValue();
Object value = JavaUtils.getHolderValue(holder);
ParameterDesc paramDesc = param.getParamDesc();
param.setObjectValue(value);
if (paramDesc != null && paramDesc.isOutHeader())
{
resEnv.addHeader(new RPCHeaderParam(param));
}
else
{
resBody.addParam(param);
}
}
}
}
catch (Exception e)