throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
out.println("<h2>Servlet ClientServlet at " + request.getContextPath () + "</h2>");
DefaultSTSIssuedTokenConfiguration config = new DefaultSTSIssuedTokenConfiguration();
STSIssuedTokenFeature feature = new STSIssuedTokenFeature(config);
org.me.calculator.client.CalculatorWS port = service.getCalculatorWSPort(new WebServiceFeature[]{feature});
int i = Integer.parseInt(request.getParameter("value1"));
int j = Integer.parseInt(request.getParameter("value2"));
config.setTokenType("urn:oasis:names:tc:SAML:1.0:assertion");
MyClaims claims = new MyClaims();
claims.addClaimType(MyClaims.ROLE);
config.setClaims(claims);
int result = port.add(i, j);
out.println("<br/>");
out.println("Result:");
out.println("" + i + " + " + j + " = " + result);
out.println("<br/>");
config.setTokenType("urn:oasis:names:tc:SAML:2.0:assertion");
MyClaims claims1 = new MyClaims();
claims1.addClaimType(MyClaims.LOCALITY);
config.setClaims(claims1);
result = port.add(i, j);
out.println("<br/>");
out.println("Result:");
out.println("" + i + " + " + j + " = " + result);