How to set Status into Response?

o haya ohaya at yahoo.com
Sat Feb 16 03:47:50 EST 2019


Hi,

I am trying to add a <Status> to the Response that I am building:

<samlp:Status>
    <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</samlp:Status>

but I am having problems.

I have this method that I call:

        Status myStatus = buildStatus("urn:oasis:names:tc:SAML:2.0:status:Success", "ABCDEF");
        if (myStatus == null) {
        	System.out.println("myStatus is null");
        } else {
        	System.out.println("myStatus is NOT null");
        }

and that is saying "NOT null".  However, when I try to set the Status into the Response:

     resp.getStatus().setStatusCode(myStatus.getStatusCode());

I am getting a NullPointerException.

Why is that, and how SHOULD I be doing that?

Thanks,
Jim



More information about the dev mailing list