I am trying to convert a samlResponse in string format to org.w3c.dom.Document to validate it. But it yields null even though I have used couple of different ways.
One way is as below:
Here even the inputStream is null.
BasicParserPool bpp = new BasicParserPool();
bpp.setNamespaceAware(true);
Document doc= bpp.parse(new ByteArrayInputStream(samlResponse.getBytes()));
Element responseElement = doc.getDocumentElement();
where the string samlResponse is as below (just a snippet):
String samlResponse = "<saml2p:Response xmlns:saml2p=\"urn:oasis:names:tc:SAML:2.0:protocol\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" Version=\"2.0\"> <saml2:Issuer etc etc
Any thoughts where I am going wrong?