if (is == null)
throw new IllegalArgumentException("Input Stream to request file is null");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
SOAPSAMLXACMLServlet servlet = new SOAPSAMLXACMLServlet();
HashMap<String, String> map = new HashMap<String, String>();
map.put("soapVersion", "1.2");
map.put("policyConfigFileName", "xacml/policies/config/rsaConfPolicyConfig.xml");
ServletContext sc = new TestServletContext(map);
servlet.init(new TestServletConfig(sc));
if (needSOAPWrapping)
is = getSOAPStream(is);
ServletRequest sreq = new TestServletRequest(is);
ServletResponse sresp = new TestServletResponse(baos);
servlet.service(sreq, sresp);
sresp.flushBuffer(); // Flush the servlet response ServletOutputStream to our baos
ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());