You are viewing a plain text version of this content. The canonical link for it is here.
Posted to stonehenge-commits@incubator.apache.org by be...@apache.org on 2009/09/30 16:21:14 UTC

svn commit: r820332 [6/7] - in /incubator/stonehenge/trunk/stocktrader/metro: ./ active_sts/ active_sts/etc/ active_sts/src/ active_sts/src/org/ active_sts/src/org/apache/ active_sts/src/org/apache/stonehenge/ active_sts/src/org/apache/stonehenge/stock...

Modified: incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/bean/RegisterBean.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/bean/RegisterBean.java?rev=820332&r1=820331&r2=820332&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/bean/RegisterBean.java (original)
+++ incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/bean/RegisterBean.java Wed Sep 30 16:21:08 2009
@@ -1,166 +1,146 @@
 package org.apache.stonehenge.stocktrader.bean;
 
-import java.math.BigDecimal;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.servlet.http.HttpServletRequest;
-
-import org.tempuri.ITradeServices;
-
 import com.ibm.websphere.samples.trade.AccountProfileDataBean;
 import com.ibm.websphere.samples.trade.GetAccountProfileData;
 import com.ibm.websphere.samples.trade.Register;
 import com.ibm.websphere.samples.trade.UpdateAccountProfile;
+import org.tempuri.ITradeServices;
+
+import javax.annotation.PostConstruct;
+import java.math.BigDecimal;
 
 public class RegisterBean {
-	private String userId;
-	private BigDecimal openBalance;
-	private String fullName;
-	private String email;
-	private String address;
-	private String password;
-	private String creditCard;
-	private String confPassword;
-	private ITradeServices businessService;
-	private String currentUser;
-
-	public void setBusinessService(ITradeServices businessService) {
-		this.businessService = businessService;
-	}	
-
-	public void setCurrentUser(String currentUser) {
-		this.currentUser = currentUser;
-	}
-	
-	@javax.annotation.PostConstruct
-	public void initialize(){
-		if(currentUser != null){
-			AccountProfileDataBean userAccount = getUserAccountProfileDataReturn();
-			userId = userAccount.getUserID();
-			email = userAccount.getEmail();
-			fullName = userAccount.getFullName();
-			address = userAccount.getAddress();
-			password = userAccount.getPassword();
-			confPassword = userAccount.getPassword();
-			creditCard = userAccount.getCreditCard();
-		}
-	}
-	
-	public AccountProfileDataBean getUserAccountProfileDataReturn() {
-			GetAccountProfileData profileData = new GetAccountProfileData();
-			profileData.setUserID(currentUser);
-			return businessService.getAccountProfileData(profileData).getGetAccountProfileDataReturn();
-	}
-
-	public BigDecimal getOpenBalance() {
-		return openBalance;
-	}
-
-	public void setOpenBalance(BigDecimal openBalance) {
-		this.openBalance = openBalance;
-	}
-
-	public String getAddress() {
-		return address;
-	}
-
-	public void setAddress(String address) {
-		this.address = address;
-	}
-
-	public String getFullName() {
-		return fullName;
-	}
-
-	public void setFullName(String fullname) {
-		this.fullName = fullname;
-	}
-
-	public String getEmail() {
-		return email;
-	}
-
-	public void setEmail(String email) {
-		this.email = email;
-	}
-
-	public String getPassword() {
-		return password;
-	}
-
-	public void setPassword(String password) {
-		this.password = password;
-	}
-
-	public String getCreditCard() {
-		return creditCard;
-	}
-
-	public void setCreditCard(String creditcard) {
-		this.creditCard = creditcard;
-	}
-
-	public String getConfPassword() {
-		return confPassword;
-	}
-
-	public void setConfPassword(String confpassword) {
-		this.confPassword = confpassword;
-	}
-
-	public ITradeServices getBusinessService() {
-		return businessService;
-	}
-
-	public String getUserId() {
-		return userId;
-	}
-
-	public void setUserId(String userId) {
-		this.userId = userId;
-	}
-	
-	public String register() {
-		Register register = new Register();
-		register.setAddress(address);
-		register.setCreditcard(creditCard);
-		register.setEmail(email);
-		register.setFullname(fullName);
-		register.setOpenBalance(openBalance);
-		register.setPassword(password);
-		register.setUserID(userId);
-		businessService.register(register);
-		return "success";
-	}
-
-	public void passwordValidate(FacesContext context, UIComponent component,
-			Object value) {
-		HttpServletRequest request = (HttpServletRequest) context
-				.getExternalContext().getRequest();
-		request.getParameterMap();
-		String password = request.getParameter("AccountProfile:Password");
-		String confirmPassword = (String) value;
-		if (!password.equals(confirmPassword)) {
-			FacesMessage message = new FacesMessage();
-			message.setSeverity(FacesMessage.SEVERITY_ERROR);
-			message.setSummary("Passwords Don't Match!");
-			message.setDetail("Passwords Don't Match!");
-			context.addMessage("AccountProfile:Confirm Password :", message);
-		}
-	}
-	public void updateProfile()
-	{
-		UpdateAccountProfile profile = new UpdateAccountProfile();
-		AccountProfileDataBean profileToBeUpdated = new AccountProfileDataBean();
-		profileToBeUpdated.setAddress(address);
-		profileToBeUpdated.setUserID(userId);
-		profileToBeUpdated.setEmail(email);
-		profileToBeUpdated.setPassword(password);
-		profileToBeUpdated.setFullName(fullName);
-		profileToBeUpdated.setCreditCard(creditCard);
-		profile.setProfileData(profileToBeUpdated);
-		businessService.updateAccountProfile(profile);
-	}
+    private String userId;
+    private BigDecimal openBalance;
+    private String fullName;
+    private String email;
+    private String address;
+    private String password;
+    private String creditCard;
+    private String confPassword;
+    private ITradeServices businessService;
+
+    private String currentUser;
+
+    public ITradeServices getBusinessService() {
+        return businessService;
+    }
+
+    public void setBusinessService(ITradeServices businessService) {
+        this.businessService = businessService;
+    }
+
+    public void setCurrentUser(String currentUser) {
+        this.currentUser = currentUser;
+    }
+
+    @PostConstruct
+    public void initialize() {
+        if (currentUser != null) {
+            AccountProfileDataBean userAccount = getUserAccountProfileDataReturn();
+            userId = userAccount.getUserID();
+            email = userAccount.getEmail();
+            fullName = userAccount.getFullName();
+            address = userAccount.getAddress();
+            password = userAccount.getPassword();
+            confPassword = userAccount.getPassword();
+            creditCard = userAccount.getCreditCard();
+        }
+    }
+
+    public AccountProfileDataBean getUserAccountProfileDataReturn() {
+        GetAccountProfileData profileData = new GetAccountProfileData();
+        profileData.setUserID(currentUser);
+        return businessService.getAccountProfileData(profileData).getGetAccountProfileDataReturn();
+    }
+
+    public BigDecimal getOpenBalance() {
+        return openBalance;
+    }
+
+    public void setOpenBalance(BigDecimal openBalance) {
+        this.openBalance = openBalance;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getFullName() {
+        return fullName;
+    }
+
+    public void setFullName(String fullname) {
+        this.fullName = fullname;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getCreditCard() {
+        return creditCard;
+    }
+
+    public void setCreditCard(String creditcard) {
+        this.creditCard = creditcard;
+    }
+
+    public String getConfPassword() {
+        return confPassword;
+    }
+
+    public void setConfPassword(String confpassword) {
+        this.confPassword = confpassword;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String register() {
+        Register register = new Register();
+        register.setAddress(address);
+        register.setCreditcard(creditCard);
+        register.setEmail(email);
+        register.setFullname(fullName);
+        register.setOpenBalance(openBalance);
+        register.setPassword(password);
+        register.setUserID(userId);
+        businessService.register(register);
+        return "success";
+    }
+
+    public void updateProfile() {
+        UpdateAccountProfile profile = new UpdateAccountProfile();
+        AccountProfileDataBean profileToBeUpdated = new AccountProfileDataBean();
+        profileToBeUpdated.setAddress(address);
+        profileToBeUpdated.setUserID(userId);
+        profileToBeUpdated.setEmail(email);
+        profileToBeUpdated.setPassword(password);
+        profileToBeUpdated.setFullName(fullName);
+        profileToBeUpdated.setCreditCard(creditCard);
+        profile.setProfileData(profileToBeUpdated);
+        businessService.updateAccountProfile(profile);
+    }
 }

Added: incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/bean/Service.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/bean/Service.java?rev=820332&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/bean/Service.java (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/bean/Service.java Wed Sep 30 16:21:08 2009
@@ -0,0 +1,27 @@
+package org.apache.stonehenge.stocktrader.bean;
+
+import org.datacontract.schemas._2004._07.trade.ServiceLocation;
+
+public class Service extends ServiceLocation {
+    public Service() {
+    }
+
+    public Service(String name,String url, boolean isSec) {
+        serviceName = name;
+        serviceURL = url;
+        sec = isSec;
+    }
+
+    public boolean getIsSec() {
+        return sec;
+    }
+
+    public void setIsSec(boolean sec) {
+        this.sec = sec;
+    }
+
+    public static Service service(ServiceLocation serviceLocation){
+        return new Service(serviceLocation.getServiceName(),serviceLocation.getServiceURL(),serviceLocation.isSec());
+    }
+
+}

Added: incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/filter/STSFilter.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/filter/STSFilter.java?rev=820332&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/filter/STSFilter.java (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/filter/STSFilter.java Wed Sep 30 16:21:08 2009
@@ -0,0 +1,69 @@
+package org.apache.stonehenge.stocktrader.filter;
+
+import com.iplanet.sso.SSOException;
+import com.iplanet.sso.SSOToken;
+import com.iplanet.sso.SSOTokenManager;
+import org.apache.stonehenge.stocktrader.service.CookieManager;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+public class STSFilter implements Filter {
+
+    private static CookieManager cookieManager = new CookieManager();
+
+    public void init(FilterConfig filterConfig) throws ServletException {
+    }
+
+    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws
+            IOException, ServletException {
+        if (!(servletRequest instanceof HttpServletRequest && servletResponse instanceof HttpServletResponse)) {
+            throw new ServletException("");
+        }
+        HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
+        HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;
+        try {
+            doFilter(httpServletRequest, httpServletResponse, filterChain);
+        } catch (SSOException e) {
+            throw new ServletException(e);
+        }
+    }
+
+    private void doFilter(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse,
+                          FilterChain filterChain) throws SSOException, IOException, ServletException {
+        String userName = cookieManager.getCurrentUser(httpServletRequest);
+        if (userName == null) {
+            SSOTokenManager manager = SSOTokenManager.getInstance();
+            SSOToken ssoToken = manager.createSSOToken(httpServletRequest);
+            if (!manager.isValidToken(ssoToken)) {
+                throw new RuntimeException("SSOToken from OpenSSO is not valid!");
+            }
+            else {
+                userName = ssoToken.getProperty("id");
+                if (userName == null) {
+                    userName = "uid:0";}
+                Cookie usernameCookie = new Cookie("username", userName);
+                httpServletResponse.addCookie(usernameCookie);
+
+                String assertion = ssoToken.getProperty("Assertion");
+
+                assertion = assertion.replaceAll("\\\\\"", "'").replaceAll("\"", "'").replaceAll(">\\s+?<", "><");
+
+                Cookie assertionCookie = new Cookie("Assertion", assertion);
+                httpServletResponse.addCookie(assertionCookie);
+            }
+        }
+        filterChain.doFilter(httpServletRequest, httpServletResponse);
+    }
+
+    public void destroy() {
+    }
+}

Modified: incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/BusinessServiceClient.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/BusinessServiceClient.java?rev=820332&r1=820331&r2=820332&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/BusinessServiceClient.java (original)
+++ incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/BusinessServiceClient.java Wed Sep 30 16:21:08 2009
@@ -1,22 +1,40 @@
 package org.apache.stonehenge.stocktrader.service;
 
+import com.ibm.websphere.samples.trade.GetAccountData;
+import com.ibm.websphere.samples.trade.GetHoldings;
+import com.ibm.websphere.samples.trade.GetMarketSummary;
+import com.sun.xml.ws.api.security.trust.client.STSIssuedTokenConfiguration;
+import com.sun.xml.ws.security.Token;
+import com.sun.xml.ws.security.trust.GenericToken;
+import com.sun.xml.ws.security.trust.STSIssuedTokenFeature;
+import com.sun.xml.ws.security.trust.impl.client.DefaultSTSIssuedTokenConfiguration;
+import com.sun.xml.wss.XWSSecurityException;
+import com.sun.xml.wss.saml.util.SAMLUtil;
 import org.tempuri.ITradeServices;
 import org.tempuri.TradeServiceWsas;
-
+import org.w3c.dom.Element;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
 import javax.xml.ws.BindingProvider;
-
-import com.ibm.websphere.samples.trade.Login;
-import com.ibm.websphere.samples.trade.LoginResponse;
+import javax.xml.ws.WebServiceFeature;
+import java.io.StringReader;
 
 public final class BusinessServiceClient {
-    private static BusinessServiceClient self = null;
-    private static ConfigServiceClient configServiceClient = null;
-    private static ITradeServices tradeServices = null;
+    private static BusinessServiceClient self;
+    private static ConfigServiceClient configServiceClient;
+    private String samlAssertion;
+    private static ITradeServices tradeServices;
+    public String getSamlAssertion() {
+        return samlAssertion;
+    }
+
+    public void setSamlAssertion(String samlAssertion) {
+        this.samlAssertion = samlAssertion;
+    }
 
     public BusinessServiceClient() {
         configServiceClient = ConfigServiceClient.getInstance();
-        TradeServiceWsas service = new TradeServiceWsas();
-        tradeServices = service.getBasicHttpBindingITradeServices();
     }
 
     public static BusinessServiceClient getInstance() {
@@ -27,20 +45,49 @@
     }
 
     public ITradeServices getBusinessService() {
-        BusinessServiceConfig config = configServiceClient.getConfig();
+        TradeServiceWsas service = new TradeServiceWsas();
+        BusinessServiceConfig config = configServiceClient.getClientConfig();
+        if (config.getEndpointURL().endsWith("STS")) {
+            try {
+                StringReader stringReader = new StringReader(samlAssertion);
+                XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(stringReader);
+                Element element = SAMLUtil.createSAMLAssertion(reader);
+                Token actAsToken = new GenericToken(element);
+
+                STSIssuedTokenConfiguration tokenConfiguration = new DefaultSTSIssuedTokenConfiguration();
+                tokenConfiguration.getOtherOptions().put(STSIssuedTokenConfiguration.ACT_AS, actAsToken);
+                STSIssuedTokenFeature feature = new STSIssuedTokenFeature(tokenConfiguration);
+
+                tradeServices = service.getCustomBindingITradeServices(new WebServiceFeature[]{feature});
+            } catch (XMLStreamException e) {
+                throw new RuntimeException("thrown in getBusinessService() " + samlAssertion, e);
+            } catch (XWSSecurityException e) {
+                throw new RuntimeException("thrown in createSAMLAssertion() " + samlAssertion, e);
+            }
+        } else {
+            tradeServices = service.getBasicHttpBindingITradeServices();
+        }
         ((BindingProvider) tradeServices).getRequestContext()
                 .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, config.getEndpointURL());
+
         return tradeServices;
     }
 
-    public static void main(String[] args) {
-        BusinessServiceClient businessServiceClient = BusinessServiceClient.getInstance();
-        ITradeServices service = businessServiceClient.getBusinessService();
-        Login loginParam = new Login();
-        loginParam.setUserID("uid:0");
-        loginParam.setPassword("xxx");
-        LoginResponse response = service.login(loginParam);
-        assert response.getLoginReturn() != null;
-        System.out.println("connect successfully!!!");
-    }
+//    public static void main(String[] args) {
+//        BusinessServiceClient businessServiceClient = BusinessServiceClient.getInstance();
+//        String assertion = "<saml:Assertion xmlns:saml=\\\"urn:oasis:names:tc:SAML:1.0:assertion\\\" AssertionID=\\\"see503bfdd2868f478b8fb27cbdf12687adba240201\\\" IssueInstant=\\\"2009-09-01T19:02:24Z\\\" Issuer=\\\"myidp\\\" MajorVersion=\\\"1\\\" MinorVersion=\\\"1\\\">  <saml:Conditions NotBefore=\\\"2009-09-01T18:52:24Z\\\" NotOnOrAfter=\\\"2009-09-01T19:12:24Z\\\">  <saml:AudienceRestrictionCondition>  <saml:Audience>mysp</saml:Audience>  </saml:AudienceRestrictionCondition>  </saml:Conditions>  <saml:AuthenticationStatement AuthenticationInstant=\\\"2009-09-01T18:51:48Z\\\" AuthenticationMethod=\\\"urn:com:sun:identity:DataStore\\\">  <saml:Subject>  <saml:NameIdentifier Format=\\\"http://schemas.xmlsoap.org/claims/UPN\\\">uid:0@thoughtworks.com</saml:NameIdentifier>  </saml:Subject>  </saml:AuthenticationStatement>  <Signature xmlns=\\\"http://www.w3.org/2000/09/xmldsig#\\\">  <SignedInfo>  <CanonicalizationMethod Algorithm=\\\"http://www.w3.org/2001/10/xml-exc-c1
 4n#\\\"/>  <SignatureMethod Algorithm=\\\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\\\"/>  <Reference URI=\\\"#see503bfdd2868f478b8fb27cbdf12687adba240201\\\">  <Transforms>  <Transform Algorithm=\\\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\\\"/>  <Transform Algorithm=\\\"http://www.w3.org/2001/10/xml-exc-c14n#\\\"/>  </Transforms>  <DigestMethod Algorithm=\\\"http://www.w3.org/2000/09/xmldsig#sha1\\\"/>  <DigestValue>zaH/FVJgs9Qu7yywgntWDYzgyR8=</DigestValue>  </Reference>  </SignedInfo>  <SignatureValue>  QkFrH6ZpwYQbhcfsjvpbGjwpRC/TI3YthmHvkNHZqkwwdVDxeIR4SxwlyvYOQ2Q9vb4lI5LdpeA7  Oa3nmqS310wDHwjTLQFYeG20j/JNlDI/G2DVyh7wfNVhd/sRcjB6Mwtysc8l07kp/XjWP+mEi23A  5EmfbHVSliLggOCpe+Q=  </SignatureValue>  <KeyInfo>  <X509Data>  <X509Certificate>  MIICQDCCAakCBEeNB0swDQYJKoZIhvcNAQEEBQAwZzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNh  bGlmb3JuaWExFDASBgNVBAcTC1NhbnRhIENsYXJhMQwwCgYDVQQKEwNTdW4xEDAOBgNVBAsTB09w  ZW5TU08xDTALBgNVBAMTBHRlc3QwHhcNMDgwMTE1MTkxOTM5WhcNMTgwMTEyMTkxOTM
 5WjBnMQsw  CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEUMBIGA1UEBxMLU2FudGEgQ2xhcmExDDAK  BgNVBAoTA1N1bjEQMA4GA1UECxMHT3BlblNTTzENMAsGA1UEAxMEdGVzdDCBnzANBgkqhkiG9w0B  AQEFAAOBjQAwgYkCgYEArSQc/U75GB2AtKhbGS5piiLkmJzqEsp64rDxbMJ+xDrye0EN/q1U5Of+  RkDsaN/igkAvV1cuXEgTL6RlafFPcUX7QxDhZBhsYF9pbwtMzi4A4su9hnxIhURebGEmxKW9qJNY  Js0Vo5+IgjxuEWnjnnVgHTs1+mq5QYTA7E6ZyL8CAwEAATANBgkqhkiG9w0BAQQFAAOBgQB3Pw/U  QzPKTPTYi9upbFXlrAKMwtFf2OW4yvGWWvlcwcNSZJmTJ8ARvVYOMEVNbsT4OFcfu2/PeYoAdiDA  cGy/F2Zuj8XJJpuQRSE6PtQqBuDEHjjmOQJ0rV/r8mO1ZCtHRhpZ5zYRjhRC9eCbjx9VrFax0JDC  /FfwWigmrW0Y0Q==  </X509Certificate>  </X509Data>  </KeyInfo>  </Signature></saml:Assertion>";
+//        assertion = assertion.replaceAll("\\\\\"", "'").replaceAll(">\\s+?<", "><");
+//        businessServiceClient.samlAssertion = assertion;
+//        String currentUser = "uid:0";
+//        ITradeServices service = businessServiceClient.getBusinessService();
+//        GetAccountData data = new GetAccountData();
+//        data.setUserID(currentUser);
+//        service.getAccountData(data);
+//        GetMarketSummary summary = new GetMarketSummary();
+//        service.getMarketSummary(summary);
+//        GetHoldings holdingsParameter = new GetHoldings();
+//        holdingsParameter.setUserID(currentUser);
+//        service.getHoldings(holdingsParameter);
+//        System.out.println("connect successfully!!!");
+//    }
 }

Modified: incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/BusinessServiceConfig.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/BusinessServiceConfig.java?rev=820332&r1=820331&r2=820332&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/BusinessServiceConfig.java (original)
+++ incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/BusinessServiceConfig.java Wed Sep 30 16:21:08 2009
@@ -1,12 +1,16 @@
 package org.apache.stonehenge.stocktrader.service;
 
-import org.tempuri.ConfigServiceService;
+public class BusinessServiceConfig {
+    private String serviceName;
 
-import java.util.Properties;
-import java.io.InputStream;
-import java.io.IOException;
+    public String getServiceName() {
+        return serviceName;
+    }
+
+    public void setServiceName(String serviceName) {
+        this.serviceName = serviceName;
+    }
 
-public class BusinessServiceConfig {
     private String endpointURL;
 
     public String getEndpointURL() {

Modified: incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/ConfigServiceClient.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/ConfigServiceClient.java?rev=820332&r1=820331&r2=820332&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/ConfigServiceClient.java (original)
+++ incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/ConfigServiceClient.java Wed Sep 30 16:21:08 2009
@@ -1,42 +1,41 @@
 package org.apache.stonehenge.stocktrader.service;
 
-import org.datacontract.schemas._2004._07.trade.*;
+import org.apache.stonehenge.stocktrader.dal.ConfigServiceDaoFactory;
+import org.datacontract.schemas._2004._07.trade.BSConfigRequest;
+import org.datacontract.schemas._2004._07.trade.BSConfigResponse;
+import org.datacontract.schemas._2004._07.trade.BSToOPS;
+import org.datacontract.schemas._2004._07.trade.ClientConfigRequest;
+import org.datacontract.schemas._2004._07.trade.ClientConfigResponse;
+import org.datacontract.schemas._2004._07.trade.ClientToBS;
+import org.datacontract.schemas._2004._07.trade.ServiceLocation;
 import org.tempuri.ConfigService;
 import org.tempuri.ConfigServiceService;
-import traderconfighost.trade.*;
+import traderconfighost.trade.GetBSConfig;
+import traderconfighost.trade.GetBSLocations;
+import traderconfighost.trade.GetClientConfig;
+import traderconfighost.trade.GetClientConfigResponse;
+import traderconfighost.trade.GetOPSLocations;
+import traderconfighost.trade.SetBSToOPS;
+import traderconfighost.trade.SetClientToBS;
+import traderconfighost.trade.SetServiceLocation;
+import traderconfighost.trade.SetServiceLocationResponse;
 
 import javax.xml.ws.BindingProvider;
-import java.io.IOException;
-import java.io.InputStream;
 import java.util.List;
-import java.util.Properties;
 
 public final class ConfigServiceClient {
 
-    private static final String CONFIG_SERVICE_PROPERTY_FILE = "TradeServiceConfig.properties";
-    private static final String CONFIG_SERVICE_URL = "org.apache.stonehenge.stocktrader.TradeConfigService.url";
-
-    private static Properties prop = new Properties();
-
     private static ConfigServiceService service;
 
     private static ConfigServiceClient configServiceClient;
 
-    static {
-        ClassLoader cl = ConfigServiceClient.class.getClassLoader();
-        InputStream is = cl.getResourceAsStream(CONFIG_SERVICE_PROPERTY_FILE);
-        try {
-            prop.load(is);
-        } catch (IOException e) {
-        }
-    }
-
     private ConfigServiceClient() {
         ConfigService configService = new ConfigService();
         service = configService.getBasicHttpBindingConfigServiceService();
-        ((BindingProvider) service).getRequestContext()
-                .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, prop.getProperty(CONFIG_SERVICE_URL));
+        String configServiceUrl = ConfigServiceDaoFactory.getFacotry().getConfigServiceDAO().getConfigService();
 
+        ((BindingProvider) service).getRequestContext()
+                .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, configServiceUrl);
     }
 
     public static ConfigServiceClient getInstance() {
@@ -50,22 +49,47 @@
         return service.getBSLocations(new GetBSLocations()).getGetBSLocationsResult().getServiceLocation();
     }
 
-    public BusinessServiceConfig getConfig() {
-        ClientConfigResponse response = getClientConfigResponse();
+    public List<ServiceLocation> getOPSLocations() {
+        return service.getOPSLocations(new GetOPSLocations()).getGetOPSLocationsResult().getServiceLocation();
+    }
+
+    public BusinessServiceConfig getClientConfig() {
+        ServiceLocation response = getCurrentBSService();
 
         BusinessServiceConfig config = new BusinessServiceConfig();
-        config.setEndpointURL(response.getBS());
+        config.setEndpointURL(response.getServiceURL());
+        config.setServiceName(response.getServiceName());
         return config;
     }
 
-    private ClientConfigResponse getClientConfigResponse() {
+    public ServiceLocation getCurrentBSService() {
         GetClientConfig getClientConfig = new GetClientConfig();
         ClientConfigRequest configRequest = new ClientConfigRequest();
         configRequest.setClientName("METRO_CLIENT");
         getClientConfig.setClient(configRequest);
         GetClientConfigResponse clientConfigResponse = service.getClientConfig(getClientConfig);
         ClientConfigResponse response = clientConfigResponse.getGetClientConfigResult();
-        return response;
+        if (response == null) {
+            throw new RuntimeException("shouldn't be null getCurrentBSService()3");
+        }
+        ServiceLocation serviceLocation = new ServiceLocation();
+        serviceLocation.setSec(response.isSec());
+        serviceLocation.setServiceName(response.getBSName());
+        serviceLocation.setServiceURL(response.getBS());
+        return serviceLocation;
+    }
+
+    public ServiceLocation getCurrentOPSService() {
+        GetBSConfig getBSConfig = new GetBSConfig();
+        BSConfigRequest bsConfigRequest = new BSConfigRequest();
+        bsConfigRequest.setBSName(getCurrentBSService().getServiceName());
+        getBSConfig.setBs(bsConfigRequest);
+        BSConfigResponse bsConfigResponse = service.getBSConfig(getBSConfig).getGetBSConfigResult();
+        ServiceLocation serviceLocation = new ServiceLocation();
+        serviceLocation.setSec(bsConfigResponse.isSec());
+        serviceLocation.setServiceName(bsConfigResponse.getOPSName());
+        serviceLocation.setServiceURL(bsConfigResponse.getOPS());
+        return serviceLocation;
     }
 
     public boolean setConfig(String client, String bs, String ops) {
@@ -84,32 +108,24 @@
             setBsToOps.setBsConfig(bsToOps);
             service.setBSToOPS(setBsToOps);
         } catch (Exception e) {
-            e.printStackTrace();
             return false;
         }
         return true;
     }
 
-    public String getSelectedOPS() {
-        GetBSConfig getBSConfig = new GetBSConfig();
-        BSConfigRequest bsConfigRequest = new BSConfigRequest();
-        bsConfigRequest.setBSName(getClientConfigResponse().getBSName());
-        getBSConfig.setBs(bsConfigRequest);
-        return service.getBSConfig(getBSConfig).getGetBSConfigResult().getOPSName();
-    }
-
-    public String getSelectedBS() {
-        ClientConfigResponse response = getClientConfigResponse();
-        return response.getBSName();
+    public boolean setServiceLocation(String name, String url, boolean isSec) {
+        SetServiceLocation location = new SetServiceLocation();
+        ServiceLocation serviceLocation = new ServiceLocation();
+        serviceLocation.setSec(isSec);
+        serviceLocation.setServiceName(name);
+        serviceLocation.setServiceURL(url);
+        location.setLocation(serviceLocation);
+        SetServiceLocationResponse setServiceLocationResponse = service.setServiceLocation(location);
+        return setServiceLocationResponse != null;
     }
 
-    public List<ServiceLocation> getOPSLocations() {
-        return service.getOPSLocations(new GetOPSLocations()).getGetOPSLocationsResult().getServiceLocation();
-    }
-
-    public static void main(String[] args) {
-        ConfigServiceClient configServiceClient = ConfigServiceClient.getInstance();
-        assert configServiceClient.getBSLocations().size() == 3;
-        System.out.println("connect successfully!!");
+    public void setConfigServiceURL(String configServiceUrl) {
+        ((BindingProvider) service).getRequestContext()
+                .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, configServiceUrl);
     }
 }

Modified: incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/CookieManager.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/CookieManager.java?rev=820332&r1=820331&r2=820332&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/CookieManager.java (original)
+++ incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/CookieManager.java Wed Sep 30 16:21:08 2009
@@ -2,18 +2,22 @@
 
 import javax.faces.context.FacesContext;
 import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 public class CookieManager {
-
     private static final String COOKIE_USERNAME = "username";
+    private static final String COOKIE_ASSERTION = "Assertion";
     private static final int MAX_AGE = 3600;
+    private static CookieManager self = null;
 
-    public static CookieManager getInstance(){
-    	return new CookieManager();
+    public static CookieManager getInstance() {
+        if (self == null) {
+            self = new CookieManager();
+        }
+        return self;
     }
-    
+
     public String getCurrentUser() {
         return getCurrentUser(getRequest());
     }
@@ -27,6 +31,14 @@
         return null;
     }
 
+     public String getSamlAssertion() {
+         final Cookie requestCookie = getRequestCookie(getRequest(), COOKIE_ASSERTION);
+        if (requestCookie != null) {
+            return requestCookie.getValue();
+        }
+        return null;
+    }
+
     public void writeUserCookie(String username) {
         Cookie cookie = new Cookie(COOKIE_USERNAME, username);
         cookie.setMaxAge(MAX_AGE);
@@ -36,10 +48,10 @@
 
     public void deleteUserCookie() {
         Cookie cookie = getRequestCookie(getRequest(), COOKIE_USERNAME);
-		if (cookie != null) {
-		    cookie.setMaxAge(0);
-		    getResponse().addCookie(cookie);
-		}
+        if (cookie != null) {
+            cookie.setMaxAge(0);
+            getResponse().addCookie(cookie);
+        }
     }
 
     private Cookie getRequestCookie(HttpServletRequest request, String name) {
@@ -55,7 +67,7 @@
         }
         return null;
     }
-    
+
     private HttpServletRequest getRequest() {
         FacesContext facesContext = FacesContext.getCurrentInstance();
         return (HttpServletRequest) facesContext.getExternalContext().getRequest();
@@ -65,4 +77,5 @@
         FacesContext facesContext = FacesContext.getCurrentInstance();
         return (HttpServletResponse) facesContext.getExternalContext().getResponse();
     }
+
 }
\ No newline at end of file

Added: incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/SamlAssertionRequest.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/SamlAssertionRequest.java?rev=820332&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/SamlAssertionRequest.java (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/service/SamlAssertionRequest.java Wed Sep 30 16:21:08 2009
@@ -0,0 +1,43 @@
+package org.apache.stonehenge.stocktrader.service;
+
+import com.iplanet.sso.SSOException;
+import com.iplanet.sso.SSOToken;
+import com.iplanet.sso.SSOTokenManager;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.Writer;
+import java.security.Principal;
+
+public class SamlAssertionRequest extends HttpServlet {
+    @Override
+    protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws
+            ServletException, IOException {
+        Writer out = httpServletResponse.getWriter();
+        try {
+            SSOTokenManager manager = SSOTokenManager.getInstance();
+            SSOToken token = manager.createSSOToken(httpServletRequest);
+            if (!manager.isValidToken(token)) {
+                out.write("No FM session");
+            } else {
+                Principal principal = token.getPrincipal();
+                out.write("FM session:" + principal.getName());
+                out.write("<br>  principal: "+ principal.toString());
+                out.write("<br>  prop mail=" + token.getProperty("mail"));
+                out.write("<br>  prop id=" + token.getProperty("id"));
+                out.write("<br>  " + token.toString());
+            }
+            String assertion = token.getProperty("Assertion");
+
+            out.write("<br> Assertion: " + assertion);
+        } catch (SSOException e) {
+            throw new RuntimeException("SSOException ", e);
+        }
+        catch (RuntimeException re) {
+            throw re;
+        }
+    }
+}

Added: incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/validator/PasswordValidator.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/validator/PasswordValidator.java?rev=820332&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/validator/PasswordValidator.java (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/validator/PasswordValidator.java Wed Sep 30 16:21:08 2009
@@ -0,0 +1,25 @@
+package org.apache.stonehenge.stocktrader.validator;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+import javax.servlet.http.HttpServletRequest;
+
+public class PasswordValidator implements Validator {
+
+    public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
+        String passwordExpression = (String) uiComponent.getAttributes().get("password");
+        HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
+        String password = request.getParameter(passwordExpression);
+
+        String confirmPassword = (String) value;
+        if (!confirmPassword.equals(password)) {
+            FacesMessage message = new FacesMessage();
+            message.setSeverity(FacesMessage.SEVERITY_ERROR);
+            message.setSummary("Passwords Don't Match!");
+            throw new ValidatorException(message);
+        }
+    }
+}

Added: incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/validator/URLValidator.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/validator/URLValidator.java?rev=820332&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/validator/URLValidator.java (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/org/apache/stonehenge/stocktrader/validator/URLValidator.java Wed Sep 30 16:21:08 2009
@@ -0,0 +1,23 @@
+package org.apache.stonehenge.stocktrader.validator;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+import javax.servlet.http.HttpServletRequest;
+
+public class URLValidator implements Validator {
+    static String REGEX = "http(s)?://([\\w\\.]+|(\\d{1,3}(\\.?\\d{1,3}){3}))(:\\d*)?(/.*)?";
+
+    public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
+        String url = (String) value;
+        HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
+            if (!url.matches(REGEX)) {
+                FacesMessage message = new FacesMessage();
+                message.setSeverity(FacesMessage.SEVERITY_ERROR);
+                message.setSummary("Invalid URL specified please use (http://...)");
+                throw new ValidatorException(message);
+        }
+    }
+}

Added: incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/wsit-client.xml
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/wsit-client.xml?rev=820332&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/wsit-client.xml (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/trader_client/src/wsit-client.xml Wed Sep 30 16:21:08 2009
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions name="OrderProcessor" targetNamespace="http://tempuri.org/"
+                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/"
+                  xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+                  xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://tempuri.org/"
+                  xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
+                  xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+                  xmlns:i0="http://trade.samples.websphere.ibm.com"
+                  xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"
+                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+                  xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
+                  xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+                  xmlns:wsa10="http://www.w3.org/2005/08/addressing"
+                  xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
+    <wsp:Policy wsu:Id="ClientKeystorePolicy"
+                xmlns:sc="http://schemas.sun.com/2006/03/wss/client"
+                xmlns:wspp="http://java.sun.com/xml/ns/wsit/policy"
+                xmlns:scc="http://schemas.sun.com/ws/2006/05/sc/client">
+        <wsp:ExactlyOne>
+            <wsp:All>
+                <sunsp:DisableInclusivePrefixList
+                        xmlns:sunsp="http://schemas.sun.com/2006/03/wss/client"></sunsp:DisableInclusivePrefixList>
+
+                <sc:KeyStore wspp:visibility="private" location="stonehenge-keystore.jks"
+                             type="JKS" alias="mykey" storepass="changeit"></sc:KeyStore>
+                <sc:TrustStore wspp:visibility="private" location="stonehenge-truststore.jks"
+                               type="JKS" storepass="changeit" peeralias="mykey"></sc:TrustStore>
+
+                <scc:SCClientConfiguration wspp:visibility="private">
+                    <scc:LifeTime>36000</scc:LifeTime>
+                </scc:SCClientConfiguration>
+
+                <tc:PreconfiguredSTS xmlns:tc="http://schemas.sun.com/ws/2006/05/trust/client"
+                                     endpoint="http://localhost:8091/active_sts/ActiveSTS"
+                                     wsdlLocation="http://localhost:8091/active_sts/ActiveSTS?wsdl"
+                                     serviceName="SecurityTokenService"
+                                     portName="ISecurityTokenService_Port"
+                                     namespace="http://tempuri.org/" shareToken="true">
+                </tc:PreconfiguredSTS>
+            </wsp:All>
+        </wsp:ExactlyOne>
+    </wsp:Policy>
+
+    <wsdl:import namespace="http://trade.samples.websphere.ibm.com" location="wsdl0.wsdl">
+    </wsdl:import>
+
+    <wsdl:binding name="CustomBinding_ITradeServices" type="i0:ITradeServices">
+        <wsp:PolicyReference URI="#ClientKeystorePolicy"/>
+        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="emptyMethodAction">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="isOnline">
+            <soap:operation soapAction="isOnline" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+        </wsdl:operation>
+        <wsdl:operation name="login">
+            <soap:operation soapAction="http://trade.samples.websphere.ibm.com/ITradeServices/login" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getOrders">
+            <soap:operation soapAction="getOrders" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getAccountData">
+            <soap:operation soapAction="getAccountData" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getAccountProfileData">
+            <soap:operation soapAction="getAccountProfileData" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="updateAccountProfile">
+            <soap:operation soapAction="updateAccountProfile" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="logout">
+            <soap:operation soapAction="logout" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="buy">
+            <soap:operation soapAction="buy" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="sell">
+            <soap:operation soapAction="sell" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getHoldings">
+            <soap:operation soapAction="getHoldings" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="register">
+            <soap:operation soapAction="register" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getClosedOrders">
+            <soap:operation soapAction="getClosedOrders" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getMarketSummary">
+            <soap:operation soapAction="getMarketSummary" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getQuote">
+            <soap:operation soapAction="http://trade.samples.websphere.ibm.com/ITradeServices/getQuote"
+                            style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getHolding">
+            <soap:operation soapAction="getHolding" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getTopOrders">
+            <soap:operation soapAction="getTopOrders" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="sellEnhanced">
+            <soap:operation soapAction="sellEnhanced" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+
+    <wsdl:service name="TradeServiceWsas">
+        <wsdl:port name="CustomBinding_ITradeServices" binding="tns:CustomBinding_ITradeServices">
+            <soap:address location=""/>
+        </wsdl:port>
+    </wsdl:service>
+
+    <wsp:Policy wsu:Id="STSClientKeystorePolicy"
+                xmlns:sc="http://schemas.sun.com/2006/03/wss/client"
+                xmlns:wspp="http://java.sun.com/xml/ns/wsit/policy"
+                xmlns:scc="http://schemas.sun.com/ws/2006/05/sc/client">
+        <wsp:ExactlyOne>
+            <wsp:All>
+                <sc:KeyStore wspp:visibility="private" location="stonehenge-keystore.jks"
+                             type="JKS" alias="mykey" storepass="changeit"></sc:KeyStore>
+                <sc:TrustStore wspp:visibility="private" location="stonehenge-truststore.jks"
+                               type="JKS" storepass="changeit" peeralias="mykey"></sc:TrustStore>
+
+                <sc:CallbackHandlerConfiguration xmlns:sc="http://schemas.sun.com/2006/03/wss/client">
+                    <sc:CallbackHandler  name="usernameHandler"  default="uid:0"/>
+                    <sc:CallbackHandler  name="passwordHandler"  default="xxx"/>
+                </sc:CallbackHandlerConfiguration>
+            </wsp:All>
+        </wsp:ExactlyOne>
+    </wsp:Policy>
+
+    <wsdl:message name="ISecurityTokenService_IssueToken_InputMessage">
+        <wsdl:part name="rstMessage" element="q1:MessageBody" xmlns:q1="http://schemas.message.com/Message"/>
+    </wsdl:message>
+    <wsdl:message name="ISecurityTokenService_IssueToken_OutputMessage">
+        <wsdl:part name="IssueTokenResult" element="q2:MessageBody" xmlns:q2="http://schemas.message.com/Message"/>
+    </wsdl:message>
+
+    <wsdl:portType name="ISecurityTokenService">
+        <wsdl:operation name="IssueToken">
+            <wsdl:input wsap:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue"
+                        message="tns:ISecurityTokenService_IssueToken_InputMessage"/>
+            <wsdl:output wsap:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/Issue"
+                         message="tns:ISecurityTokenService_IssueToken_OutputMessage"/>
+        </wsdl:operation>
+    </wsdl:portType>
+
+    <wsdl:binding name="ISecurityTokenService_Binding" type="tns:ISecurityTokenService">
+        <wsp:PolicyReference URI="#STSClientKeystorePolicy"/>
+        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="IssueToken">
+            <soap:operation soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+
+    <wsdl:service name="SecurityTokenService">
+        <wsdl:port name="ISecurityTokenService_Port" binding="tns:ISecurityTokenService_Binding">
+            <soap:address location=""/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

Added: incubator/stonehenge/trunk/stocktrader/metro/trader_client/web/ConfigServiceSelector.xhtml
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/trader_client/web/ConfigServiceSelector.xhtml?rev=820332&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/trader_client/web/ConfigServiceSelector.xhtml (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/trader_client/web/ConfigServiceSelector.xhtml Wed Sep 30 16:21:08 2009
@@ -0,0 +1,44 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:ui="http://java.sun.com/jsf/facelets"
+      xmlns:h="http://java.sun.com/jsf/html"
+      xmlns:c="http://java.sun.com/jstl/core"
+      xmlns:a4j="http://richfaces.org/a4j"
+      xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:s="http://stonehenge.apache.com/jsf">
+<body>
+<ui:composition template="/template.xhtml">
+    <ui:define name="title">
+        Configuration
+    </ui:define>
+    <ui:define name="body">
+        <br/>
+
+        <div class="login" style="text-align:left">
+            <h:form id="serviceUrl">
+                <h:panelGrid columns="2" cellspacing="5" width="520px">
+                    <h:outputLabel for="url">
+                        <h:outputText value="Configuration Service URL "/>
+                    </h:outputLabel>
+                    <h:inputText id="url" value="#{configServiceBean.configServiceUrl}" required="true"
+                                 style="WIDTH:300px">
+                        <f:validator validatorId="urlValidator"/>
+                    </h:inputText>
+
+                    <h:panelGroup/>
+                    <h:commandButton title="Set" value="Set" action="#{configServiceBean.setConfigUrl}"/>
+                    <h:commandButton title="Restore Defaults" value="Restore Defaults"
+                                     action="#{configServiceBean.restoreDefaultConfigServiceUrl}"/>
+                    <h:commandButton title="Next Configuration Page" value="Next Configuration Page"
+                                     action="#{configServiceBean.nextConfig}"/>
+                </h:panelGrid>
+            </h:form>
+        </div>
+        <h:messages style="color: red"/>
+        <br/>
+
+        <div align="center" style="color:green">
+            <h:outputLabel value="#{configServiceBean.result}"></h:outputLabel></div>
+    </ui:define>
+</ui:composition>
+</body>
+</html>
\ No newline at end of file

Modified: incubator/stonehenge/trunk/stocktrader/metro/trader_client/web/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/trader_client/web/WEB-INF/faces-config.xml?rev=820332&r1=820331&r2=820332&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/trader_client/web/WEB-INF/faces-config.xml (original)
+++ incubator/stonehenge/trunk/stocktrader/metro/trader_client/web/WEB-INF/faces-config.xml Wed Sep 30 16:21:08 2009
@@ -2,13 +2,23 @@
 <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
-              version="1.2"> 
-  <application>
-    <view-handler>
-      com.sun.facelets.FaceletViewHandler
-    </view-handler>    
-  </application> 
-     
+              version="1.2">
+    <application>
+        <view-handler>
+            com.sun.facelets.FaceletViewHandler
+        </view-handler>
+    </application>
+
+    <validator>
+        <validator-id>stonehenge.passwordValidator</validator-id>
+        <validator-class>org.apache.stonehenge.stocktrader.validator.PasswordValidator</validator-class>
+    </validator>
+
+    <validator>
+        <validator-id>urlValidator</validator-id>
+        <validator-class>org.apache.stonehenge.stocktrader.validator.URLValidator</validator-class>
+    </validator>
+
     <navigation-rule>
         <from-view-id>/login.xhtml</from-view-id>
         <navigation-case>
@@ -21,7 +31,7 @@
             <to-view-id>/login.xhtml</to-view-id>
         </navigation-case>
     </navigation-rule>
-    
+
     <navigation-rule>
         <from-view-id>/quotes.xhtml</from-view-id>
         <navigation-case>
@@ -29,7 +39,7 @@
             <to-view-id>/confirmation.xhtml</to-view-id>
         </navigation-case>
     </navigation-rule>
-    
+
     <navigation-rule>
         <from-view-id>/portfolio.xhtml</from-view-id>
         <navigation-case>
@@ -37,8 +47,8 @@
             <to-view-id>/confirmation.xhtml</to-view-id>
         </navigation-case>
     </navigation-rule>
-    
-     <navigation-rule>
+
+    <navigation-rule>
         <from-view-id>/register.xhtml</from-view-id>
         <navigation-case>
             <from-outcome>success</from-outcome>
@@ -47,60 +57,111 @@
     </navigation-rule>
 
     <navigation-rule>
+        <from-view-id>/ConfigServiceSelector.xhtml</from-view-id>
+        <navigation-case>
+              <from-action>#{configServiceBean.nextConfig}</from-action>
+            <from-outcome>success</from-outcome>
+            <to-view-id>/configService.xhtml</to-view-id>
+        </navigation-case>
+    </navigation-rule>
+
+    <navigation-rule>
+        <from-view-id>/configServiceAdd.xhtml</from-view-id>
+        <navigation-case>
+            <from-outcome>success</from-outcome>
+            <to-view-id>/configurationAdvanced.xhtml</to-view-id>
+        </navigation-case>
+    </navigation-rule>
+
+    <navigation-rule>
         <from-view-id>/configService.xhtml</from-view-id>
         <navigation-case>
+            <from-action>#{configServiceBean.advancedConfig}</from-action>
             <from-outcome>success</from-outcome>
-            <to-view-id>/login.xhtml</to-view-id>
+            <to-view-id>/configurationAdvanced.xhtml</to-view-id>
+            <redirect/>
+        </navigation-case>
+    </navigation-rule>
+
+    <navigation-rule>
+        <from-view-id>/configService.xhtml</from-view-id>
+        <navigation-case>
+            <from-action>#{configServiceBean.selectorPage}</from-action>
+            <from-outcome>success</from-outcome>
+            <to-view-id>/ConfigServiceSelector.xhtml</to-view-id>
             <redirect/>
         </navigation-case>
     </navigation-rule>
-    
+
+    <navigation-rule>
+        <from-view-id>/configurationAdvanced.xhtml</from-view-id>
+        <navigation-case>
+            <from-action>#{configServiceBean.basicConfig}</from-action>
+            <from-outcome>success</from-outcome>
+            <to-view-id>/configService.xhtml</to-view-id>
+            <redirect/>
+        </navigation-case>
+    </navigation-rule>
+
     <navigation-rule>
         <from-view-id>/confirmation.xhtml</from-view-id>
-        <navigation-case>        	
-        	<from-action>#{tradeBean.buy}</from-action> 
+        <navigation-case>
+            <from-action>#{tradeBean.buy}</from-action>
             <from-outcome>success</from-outcome>
             <to-view-id>/newOrder.xhtml</to-view-id>
         </navigation-case>
-		<navigation-case>
-			<from-action>#{tradeBean.buy}</from-action> 
+        <navigation-case>
+            <from-action>#{tradeBean.buy}</from-action>
             <from-outcome>failure</from-outcome>
             <to-view-id>/login.xhtml</to-view-id>
         </navigation-case>
-        <navigation-case>        	
-        	<from-action>#{tradeBean.sell}</from-action> 
+        <navigation-case>
+            <from-action>#{tradeBean.sell}</from-action>
             <from-outcome>success</from-outcome>
             <to-view-id>/newOrder.xhtml</to-view-id>
         </navigation-case>
-		<navigation-case>
-			<from-action>#{tradeBean.sell}</from-action> 
+        <navigation-case>
+            <from-action>#{tradeBean.sell}</from-action>
             <from-outcome>failure</from-outcome>
             <to-view-id>/login.xhtml</to-view-id>
         </navigation-case>
-        <navigation-case>    
-        	<from-action>#{tradeBean.cancelBuy}</from-action> 
-        	<from-outcome>success</from-outcome> 
-            <to-view-id>/quotes.xhtml</to-view-id> 
-        </navigation-case>
-        <navigation-case>    
-        	<from-action>#{tradeBean.cancelSell}</from-action> 
-        	<from-outcome>success</from-outcome> 
-            <to-view-id>/portfolio.xhtml</to-view-id> 
+        <navigation-case>
+            <from-action>#{tradeBean.cancelBuy}</from-action>
+            <from-outcome>success</from-outcome>
+            <to-view-id>/quotes.xhtml</to-view-id>
+        </navigation-case>
+        <navigation-case>
+            <from-action>#{tradeBean.cancelSell}</from-action>
+            <from-outcome>success</from-outcome>
+            <to-view-id>/portfolio.xhtml</to-view-id>
+        </navigation-case>
+    </navigation-rule>
+
+    <navigation-rule>
+        <from-view-id>/configurationAdvanced.xhtml</from-view-id>
+        <navigation-case>
+            <from-action>#{configServiceBean.addNew}</from-action>
+            <from-outcome>success</from-outcome>
+            <to-view-id>/configServiceAdd.xhtml</to-view-id>
         </navigation-case>
     </navigation-rule>
-    
-	<managed-bean>
+
+    <managed-bean>
         <managed-bean-name>cookieManager</managed-bean-name>
         <managed-bean-class>org.apache.stonehenge.stocktrader.service.CookieManager</managed-bean-class>
         <managed-bean-scope>application</managed-bean-scope>
     </managed-bean>
-    
+
     <managed-bean>
         <managed-bean-name>businessServiceClient</managed-bean-name>
         <managed-bean-class>org.apache.stonehenge.stocktrader.service.BusinessServiceClient</managed-bean-class>
         <managed-bean-scope>application</managed-bean-scope>
+        <managed-property>
+            <property-name>samlAssertion</property-name>
+            <value>#{cookieManager.samlAssertion}</value>
+        </managed-property>
     </managed-bean>
-    
+
     <managed-bean>
         <managed-bean-name>loginBean</managed-bean-name>
         <managed-bean-class>org.apache.stonehenge.stocktrader.bean.LoginBean</managed-bean-class>
@@ -112,85 +173,85 @@
         <managed-bean-class>org.apache.stonehenge.stocktrader.bean.ConfigServiceBean</managed-bean-class>
         <managed-bean-scope>session</managed-bean-scope>
     </managed-bean>
-    
-	<managed-bean>
+
+    <managed-bean>
         <managed-bean-name>userBean</managed-bean-name>
         <managed-bean-class>org.apache.stonehenge.stocktrader.bean.UserBean</managed-bean-class>
         <managed-bean-scope>session</managed-bean-scope>
-         <managed-property>
-        	<property-name>businessService</property-name>
-        	<value>#{businessServiceClient.businessService}</value>
+        <managed-property>
+            <property-name>businessService</property-name>
+            <value>#{businessServiceClient.businessService}</value>
         </managed-property>
         <managed-property>
-        	<property-name>currentUser</property-name>
-        	<value>#{cookieManager.currentUser}</value>
+            <property-name>currentUser</property-name>
+            <value>#{cookieManager.currentUser}</value>
         </managed-property>
     </managed-bean>
 
-	<managed-bean>
+    <managed-bean>
         <managed-bean-name>accountBean</managed-bean-name>
         <managed-bean-class>org.apache.stonehenge.stocktrader.bean.AccountBean</managed-bean-class>
         <managed-bean-scope>session</managed-bean-scope>
         <managed-property>
-        	<property-name>businessService</property-name>
-        	<value>#{businessServiceClient.businessService}</value>
+            <property-name>businessService</property-name>
+            <value>#{businessServiceClient.businessService}</value>
         </managed-property>
         <managed-property>
-        	<property-name>currentUser</property-name>
-        	<value>#{cookieManager.currentUser}</value>
+            <property-name>currentUser</property-name>
+            <value>#{cookieManager.currentUser}</value>
         </managed-property>
-    </managed-bean> 
-    
+    </managed-bean>
+
     <managed-bean>
         <managed-bean-name>portfolioBean</managed-bean-name>
         <managed-bean-class>org.apache.stonehenge.stocktrader.bean.PortfolioBean</managed-bean-class>
         <managed-bean-scope>request</managed-bean-scope>
         <managed-property>
-        	<property-name>businessService</property-name>
-        	<value>#{businessServiceClient.businessService}</value>
+            <property-name>businessService</property-name>
+            <value>#{businessServiceClient.businessService}</value>
         </managed-property>
         <managed-property>
-        	<property-name>currentUser</property-name>
-        	<value>#{cookieManager.currentUser}</value>
+            <property-name>currentUser</property-name>
+            <value>#{cookieManager.currentUser}</value>
         </managed-property>
-    </managed-bean>  
-    
+    </managed-bean>
+
     <managed-bean>
         <managed-bean-name>quoteBean</managed-bean-name>
         <managed-bean-class>org.apache.stonehenge.stocktrader.bean.QuoteBean</managed-bean-class>
         <managed-bean-scope>session</managed-bean-scope>
         <managed-property>
-        	<property-name>businessService</property-name>
-        	<value>#{businessServiceClient.businessService}</value>
+            <property-name>businessService</property-name>
+            <value>#{businessServiceClient.businessService}</value>
         </managed-property>
-    </managed-bean> 
-    
+    </managed-bean>
+
     <managed-bean>
         <managed-bean-name>registerBean</managed-bean-name>
         <managed-bean-class>org.apache.stonehenge.stocktrader.bean.RegisterBean</managed-bean-class>
         <managed-bean-scope>request</managed-bean-scope>
         <managed-property>
-        	<property-name>businessService</property-name>
-        	<value>#{businessServiceClient.businessService}</value>
+            <property-name>businessService</property-name>
+            <value>#{businessServiceClient.businessService}</value>
         </managed-property>
         <managed-property>
-        	<property-name>currentUser</property-name>
-        	<value>#{cookieManager.currentUser}</value>
+            <property-name>currentUser</property-name>
+            <value>#{cookieManager.currentUser}</value>
         </managed-property>
-    </managed-bean>     
-    
-    
+    </managed-bean>
+
     <managed-bean>
         <managed-bean-name>tradeBean</managed-bean-name>
         <managed-bean-class>org.apache.stonehenge.stocktrader.bean.TradeBean</managed-bean-class>
         <managed-bean-scope>session</managed-bean-scope>
         <managed-property>
-        	<property-name>businessService</property-name>
-        	<value>#{businessServiceClient.businessService}</value>
+            <property-name>businessService</property-name>
+            <value>#{businessServiceClient.businessService}</value>
         </managed-property>
         <managed-property>
-        	<property-name>currentUser</property-name>
-        	<value>#{cookieManager.currentUser}</value>
+            <property-name>currentUser</property-name>
+            <value>#{cookieManager.currentUser}</value>
         </managed-property>
-    </managed-bean> 
+    </managed-bean>
+
 </faces-config>

Modified: incubator/stonehenge/trunk/stocktrader/metro/trader_client/web/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/trader_client/web/WEB-INF/web.xml?rev=820332&r1=820331&r2=820332&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/trader_client/web/WEB-INF/web.xml (original)
+++ incubator/stonehenge/trunk/stocktrader/metro/trader_client/web/WEB-INF/web.xml Wed Sep 30 16:21:08 2009
@@ -1,65 +1,121 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
-  <!-- Use Documents Saved as *.xhtml -->	
-  <context-param>
-    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
-    <param-value>.xhtml</param-value>
-  </context-param>
-  
-  <!-- Special Debug Output for Development -->
-  <context-param>
-    <param-name>facelets.DEVELOPMENT</param-name>
-    <param-value>true</param-value>
-  </context-param>
-	  
-  <!-- Optional JSF-RI Parameters to Help Debug -->
-  <context-param>
-    <param-name>com.sun.faces.validateXml</param-name>
-    <param-value>true</param-value>
-  </context-param>
-  <context-param>
-    <param-name>com.sun.faces.verifyObjects</param-name>
-    <param-value>true</param-value>
-  </context-param>
-    
-  <context-param>
-	<param-name>facelets.LIBRARIES</param-name>
-	<param-value>
-		/WEB-INF/facelets/tags/stonehenge.taglib.xml
-	</param-value>
-  </context-param>
-  
-  <filter>
-    <filter-name>Login Filter</filter-name>
-    <filter-class>org.apache.stonehenge.stocktrader.filter.LoginFilter</filter-class>
-  </filter>
-  <filter-mapping>
-    <filter-name>Login Filter</filter-name>
-    <url-pattern>*.faces</url-pattern>
-    <dispatcher>REQUEST</dispatcher>
-  </filter-mapping>
-  
-  <servlet>
-    <servlet-name>Faces Servlet</servlet-name>
-    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
-    <load-on-startup>1</load-on-startup>
-  </servlet>
-  
-  <servlet-mapping>
-    <servlet-name>Faces Servlet</servlet-name>
-    <url-pattern>/faces/*</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>Faces Servlet</servlet-name>
-    <url-pattern>*.faces</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>Faces Servlet</servlet-name>
-    <url-pattern>*.jsf</url-pattern>
-  </servlet-mapping>
-  
-  <welcome-file-list>
-    <welcome-file>faces/welcome.xhtml</welcome-file>
-  </welcome-file-list>
-  
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+         version="2.5">
+    <!-- Use Documents Saved as *.xhtml -->
+    <context-param>
+        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+        <param-value>.xhtml</param-value>
+    </context-param>
+
+    <!-- Special Debug Output for Development -->
+    <context-param>
+        <param-name>facelets.DEVELOPMENT</param-name>
+        <param-value>true</param-value>
+    </context-param>
+
+    <!-- Optional JSF-RI Parameters to Help Debug -->
+    <context-param>
+        <param-name>com.sun.faces.validateXml</param-name>
+        <param-value>true</param-value>
+    </context-param>
+    <context-param>
+        <param-name>com.sun.faces.verifyObjects</param-name>
+        <param-value>true</param-value>
+    </context-param>
+    <context-param>
+        <param-name>com.sun.faces.disableVersionTracking</param-name>
+        <param-value>true</param-value>
+    </context-param>
+
+    <context-param>
+        <param-name>facelets.LIBRARIES</param-name>
+        <param-value>
+            /WEB-INF/facelets/tags/stonehenge.taglib.xml
+        </param-value>
+    </context-param>
+
+    <!--<filter>-->
+        <!--<filter-name>Agent</filter-name>-->
+        <!--<filter-class>com.sun.identity.agents.filter.AmAgentFilter</filter-class>-->
+    <!--</filter>-->
+
+    <filter>
+        <filter-name>Login Filter</filter-name>
+        <filter-class>org.apache.stonehenge.stocktrader.filter.LoginFilter</filter-class>
+    </filter>
+
+    <filter>
+        <display-name>RichFaces Filter</display-name>
+        <filter-name>richfaces</filter-name>
+        <filter-class>org.ajax4jsf.Filter</filter-class>
+    </filter>
+
+    <!--<filter>-->
+        <!--<filter-name>STSFilter</filter-name>-->
+        <!--<filter-class>org.apache.stonehenge.stocktrader.filter.STSFilter</filter-class>-->
+    <!--</filter>-->
+
+    <!--<filter-mapping>-->
+        <!--<filter-name>Agent</filter-name>-->
+        <!--<url-pattern>/*</url-pattern>-->
+        <!--<dispatcher>REQUEST</dispatcher>-->
+        <!--<dispatcher>INCLUDE</dispatcher>-->
+        <!--<dispatcher>FORWARD</dispatcher>-->
+        <!--<dispatcher>ERROR</dispatcher>-->
+    <!--</filter-mapping>-->
+
+    <!--<filter-mapping>-->
+        <!--<filter-name>STSFilter</filter-name>-->
+        <!--<url-pattern>/*</url-pattern>-->
+    <!--</filter-mapping>-->
+
+    <filter-mapping>
+        <filter-name>richfaces</filter-name>
+        <servlet-name>Faces Servlet</servlet-name>
+        <dispatcher>REQUEST</dispatcher>
+        <dispatcher>FORWARD</dispatcher>
+        <dispatcher>INCLUDE</dispatcher>
+    </filter-mapping>
+
+    <filter-mapping>
+        <filter-name>Login Filter</filter-name>
+        <url-pattern>*.faces</url-pattern>
+        <dispatcher>REQUEST</dispatcher>
+    </filter-mapping>
+
+    <servlet>
+        <servlet-name>Faces Servlet</servlet-name>
+        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet>
+        <servlet-name>Token Output</servlet-name>
+        <servlet-class>org.apache.stonehenge.stocktrader.service.SamlAssertionRequest</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>Token Output</servlet-name>
+        <url-pattern>/tokenOutput</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>Faces Servlet</servlet-name>
+        <url-pattern>/faces/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>Faces Servlet</servlet-name>
+        <url-pattern>*.faces</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>Faces Servlet</servlet-name>
+        <url-pattern>*.jsf</url-pattern>
+    </servlet-mapping>
+
+    <welcome-file-list>
+        <welcome-file>faces/welcome.xhtml</welcome-file>
+    </welcome-file-list>
+
 </web-app>
\ No newline at end of file