Returns a string encoded accordingly with the SAML HTTP POST Binding specification based on the given inputStream
which must contain a valid SOAP message.
The resulting string is based on the Body of the SOAP message, which should map to a valid SAML message.
63 MessageFactory messageFactory = MessageFactory.newInstance();
64 SOAPMessage soapMessage = messageFactory.createMessage(null, inputStream);
65 SOAPBody soapBody = soapMessage.getSOAPBody();
66 Node authnRequestNode = soapBody.getFirstChild();
67 Document document = DocumentUtil.createDocument();
69 document.appendChild(document.importNode(authnRequestNode,
true));
71 return PostBindingUtil.base64Encode(DocumentUtil.asString(document));
72 }
catch (Exception e) {
73 throw new RuntimeException(
"Error creating fault message.", e);