@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
JAXBElement<RequestAbstractType> jaxbRequestType = null;
Envelope envelope = null;
XACMLAuthzDecisionQueryType xacmlRequest = null;
try
{
Document inputDoc = DocumentUtil.getDocument(req.getInputStream());
if(debug)
log.trace("Received SOAP:"+DocumentUtil.getDocumentAsString(inputDoc));
Unmarshaller un = JAXBUtil.getUnmarshaller(SOAPSAMLXACMLUtil.getPackage());
if(debug)
un.setEventHandler(new DefaultValidationEventHandler());
Object unmarshalledObject = un.unmarshal(DocumentUtil.getNodeAsStream(inputDoc));
if(unmarshalledObject instanceof JAXBElement)
{
JAXBElement<?> jaxbElement = (JAXBElement<?>) unmarshalledObject;
Object element = jaxbElement.getValue();
if(element instanceof Envelope)
{
envelope = (Envelope)element;
Body soapBody = envelope.getBody();
Object samlRequest = soapBody.getAny().get(0);
if(samlRequest instanceof JAXBElement)
{
jaxbRequestType = (JAXBElement<RequestAbstractType>)samlRequest;
jaxbRequestType = (JAXBElement<RequestAbstractType>)samlRequest;