How to create and send SAML2XMLObject through attributes
kotesh201
koteshwarv at gmail.com
Wed May 29 12:24:37 EDT 2013
Thanks Scott for your information.
I want to send some xml information as one of the attribute so using
XMLObject. For this I used opensaml to create the xml object like below
assuming my XML information is in DOM tree.
public static XMLObject testXML() {
try {
DocumentBuilderFactory dbfac =
DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
Document doc = docBuilder.newDocument();
Element root = doc.createElement("BatchRequest");
doc.appendChild(root);
Text userText1 = doc.createTextNode("TestUser1");
root.appendChild(userText1);
Unmarshaller unmarshaller =
Configuration.getUnmarshallerFactory().getUnmarshaller(root);
if (unmarshaller == null) {
System.out.println("Unable to unmarshall element, no
unmarshaller registered for message element: "
+ root.getNodeName());
}
return unmarshaller.unmarshall(root);
} catch (UnmarshallingException e) {
System.out.println("Encountered error unmarshalling element to its
XMLObject representation"+ e);
return null;
}
catch ( Exception e) {
System.out.println("Exception in creating xml objects : " +
e.getMessage());
return null;
}
when I invoke this, getting - 'local part cannot be "null" when creating a
QName'
Anything wrong in my input to unmarshaller. Please advise me.
-Kotesh
--
View this message in context: http://shibboleth.1660669.n2.nabble.com/How-to-create-and-send-SAML2XMLObject-through-attributes-tp7587046p7587078.html
Sent from the Shibboleth - Users mailing list archive at Nabble.com.
More information about the users
mailing list