mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Added session id to the result of authentication call. Updated Java web service client to pass session id on cookieif present in authentication details.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5075 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -26,7 +26,9 @@ import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import javax.transaction.UserTransaction;
|
||||
import javax.xml.rpc.server.ServletEndpointContext;
|
||||
|
||||
import org.alfresco.repo.webservice.axis.QueryConfigHandler;
|
||||
import org.alfresco.repo.webservice.types.AssociationDefinition;
|
||||
@@ -520,7 +522,7 @@ public class Utils
|
||||
* @return a UserTransaction
|
||||
*/
|
||||
public static UserTransaction getUserTransaction(MessageContext msgContext)
|
||||
{
|
||||
{
|
||||
// get the service regsistry
|
||||
ServiceRegistry svcReg = (ServiceRegistry) getSpringContext(msgContext)
|
||||
.getBean(ServiceRegistry.SERVICE_REGISTRY);
|
||||
@@ -528,6 +530,26 @@ public class Utils
|
||||
TransactionService transactionService = svcReg.getTransactionService();
|
||||
return transactionService.getUserTransaction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current http session id
|
||||
*
|
||||
* @return the current http session id, null if none found
|
||||
*/
|
||||
public static String getSessionId()
|
||||
{
|
||||
String result = null;
|
||||
ServletEndpointContext endpointContext = (ServletEndpointContext)MessageContext.getCurrentContext().getProperty("servletEndpointContext");
|
||||
if (endpointContext != null)
|
||||
{
|
||||
HttpSession session = endpointContext.getHttpSession();
|
||||
if (session != null)
|
||||
{
|
||||
result = session.getId();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of the <code>fetchSize</code> from the
|
||||
|
Reference in New Issue
Block a user