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:
Roy Wetherall
2007-02-08 11:05:21 +00:00
parent 7e64c93d6b
commit 05927316da
5 changed files with 67 additions and 6 deletions

View File

@@ -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