Skip to Content.
Sympa Menu

mace-opensaml-users - Re: [OpenSAML] Need XMLObject in assertion, I believe

Subject: OpenSAML user discussion

List archive

Re: [OpenSAML] Need XMLObject in assertion, I believe


Chronological Thread 
  • From: Brent Putman <>
  • To:
  • Subject: Re: [OpenSAML] Need XMLObject in assertion, I believe
  • Date: Wed, 21 Apr 2010 17:30:26 -0400



On 4/21/2010 5:22 PM, Jason Countryman wrote:
 
XSStringBuilder stringBuilder111 = (XSStringBuilder) Configuration.getBuilderFactory().getBuilder(XSString.TYPE_NAME);
XSString userRoleValue = stringBuilder111.buildObject("http://www.hhs.gov/healthit/nhin", "UserRole", "nhin");


See my earlier comments and example, the XSString usage here is what is throwing you off...



userRoleValue.getDOM().setAttribute("code", "112247003");
userRoleValue.getDOM().setAttribute("codeSystem", "2.16.840.1.113883.6.96");
userRoleValue.getDOM().setAttribute("codeSystemName", "SNOMED_CT");
userRoleValue.getDOM().setAttribute("displayName", "Medical doctor");




Absolutely, positively, don't modify the DOM like that.  It's just wrong.


But I'm getting a null pointer at the first getDOM().  I tried marshalling it first as well, but that didn't work either.


Right, it doesn't exist until the XMLObject is marshalled.  Pretty much the whole purpose of the library is to provider an object wrapper around the DOM.   You don't do anything with the DOM representation until you marshall it, and then you forget about the XMLObject, and do whatever you want to do with the DOM (serialize it, add it to another DOM structure, etc).





Archive powered by MHonArc 2.6.16.

Top of Page