final MediaType mediaType = createMediaType(markupRequest);
PortalContext portalContext = createPortalContext(params, markupRequest);
UserContext userContext = createUserContext(wsrpUserContext, markupRequest.getLocale(), desiredLocales);
String portletInstanceKey = runtimeContext.getPortletInstanceKey();
instanceContext = createInstanceContext(portletContext, getAccessMode(), portletInstanceKey);
WindowContext windowContext = createWindowContext(portletContext.getId(), runtimeContext);
// prepare the invocation context
WSRPPortletInvocationContext context = new WSRPPortletInvocationContext(mediaType, securityContext, portalContext, userContext, instanceContext, windowContext);
// and use it to initialize the invocation that will send to the PortletInvoker
PortletInvocation invocation = initInvocation(context);