Skip to Content.
Sympa Menu

mace-opensaml-users - unable to add ResourceContent (XML any type) to Resource attribute with opensaml.

Subject: OpenSAML user discussion

List archive

unable to add ResourceContent (XML any type) to Resource attribute with opensaml.


Chronological Thread 
  • From: "Michael Lausch" <>
  • To:
  • Subject: unable to add ResourceContent (XML any type) to Resource attribute with opensaml.
  • Date: Tue, 30 Sep 2008 14:39:57 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=LSz7yElwZusmOhRvIjzzXuQNDIMKKVGXBw1O0B5cOr1bLTFSuZVMj/IzS+3l6zVbfd jw2wSsqCN+v/6QIiJXTjp4l1QNIGSEkcOFG/QWuk1sGzeZo+oEKr7YMPAqFLI4YClvLI zUt+5BGbsWXEio+qUUL3tJV3aW80bTsmbCw2g=

I'm trying to use OpenSAML and XACML (jboss implementation, derived
from SunXACML).
I want to put some existing DOM elements into the ResourceContent
attribute of my
XACML request, but i'm unablöe to do so.
I tried to add DOM Element objects, and strings, but they were ignored
during marshalling.

Any hints?

Code snippet, which mights be all wrong:

ResourceType resourceType = new ResourceType();


ResourceContentType content = new ResourceContentType();

DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();

try {

DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.newDocument();

Element root = (Element)
document.createElementNS("rc","rootElement");

root.setAttribute("xmlns:rc","http://www.somecompany.com/2005/xyz";);

document.appendChild(root);
Element child =
(Element)document.createElement("rc:child");
root.appendChild(child);


child.appendChild(document.createTextNode("Some"));
child.appendChild(document.createTextNode(" "));
child.appendChild(document.createTextNode("text"));

content.getContent().add(root);
QName attrname = new
QName("http://www.somecompany.com/2005/xyz";,
"aaa", "rc");
content.getOtherAttributes().put(attrname, "value");
} catch (ParserConfigurationException pce) {
// Parser with specified options can't be built
pce.printStackTrace();
}


resourceType.setResourceContent(content);



Archive powered by MHonArc 2.6.16.

Top of Page