wsrpConsumer.getSessionHandler().setSessionIdIfNeeded(invocation, getRuntimeContext(), getPortletHandle());
// create markup params
org.gatein.pc.api.spi.UserContext userContext = invocation.getUserContext();
ParameterValidation.throwIllegalArgExceptionIfNull(userContext, USER_CONTEXT);
PortletInvocationContext context = invocation.getContext();
ParameterValidation.throwIllegalArgExceptionIfNull(context, INVOCATION_CONTEXT);
final MediaType contentType = context.getResponseContentType();
ParameterValidation.throwIllegalArgExceptionIfNull(contentType, CONTENT_TYPE);
String mode;
try
{