<div dir="ltr"><span style="font-size:12.8000001907349px">I wrote a method to parse the SAMLResponse from IDP, I have collected the</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">samlResponse by debugging my application</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">the same thing i am passing to the below code as an input:</span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">    public Response parseResponse(String responseMessage)</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                        throws MarshallingException, IOException, XMLParserException,</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                        MessageDecodingException {</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                String decodeResponse = decoder.decodeResponse(</span><span style="font-size:12.8000001907349px">responseMessage);</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                log.debug(&quot;decoded Response : &quot;+decodeResponse);</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                Document document = null;</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                Unmarshaller unmarshaller = null;</span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                try {</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                        BasicParserPool parserPoolManager = new BasicParserPool();</span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                        document = parserPoolManager.parse(new</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">ByteArrayInputStream(</span><span style="font-size:12.8000001907349px">decodeResponse.getBytes()));</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                        Element metadataRoot = document.getDocumentElement();</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                        QName qName = new QName(metadataRoot.</span><span style="font-size:12.8000001907349px">getNamespaceURI(),</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                                        metadataRoot.getLocalName(), metadataRoot.getPrefix());</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                        **unmarshaller = Configuration.</span><span style="font-size:12.8000001907349px">getUnmarshallerFactory()</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                                        .getUnmarshaller(qName);**</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                        Response response = (Response) unmarshaller</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                                        .unmarshall(metadataRoot);</span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                        for (Assertion assertion : response.getAssertions()) {</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                            // Processing here</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                            }</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                         } catch(Exception e) {</span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                         }</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">      }</span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">I am writing the junit test case for the above method, but it is not able to</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">unmarshall it.</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">The line &quot;unmarshaller = Configuration.</span><span style="font-size:12.8000001907349px">getUnmarshallerFactory()</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">                                        .getUnmarshaller(qName);&quot; is giving &#39;null&#39;.</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">But the i have collected the input responseMessage from my application which</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">is real data.</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">I could not be able to run the test successfully even the code is working in</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">actual application.</span><br><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Thanks &amp; Regards,</span></div><div><span style="font-size:12.8000001907349px">M.Surinaidu</span></div></div>