<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div><span>Hi Scott,</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>Thanks for the help, it worked like a charm after I followed your suggestions.</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size:
 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>For archiving purpose, the correct way is to initialize the openSAML library and terminate it at the end of the program.</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>Initialization of openSAML initializes xerces-c library and xmltooling (by default; you can specify to not to initialize it).</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="background-color: transparent;"><span>SAMLConfig::getConfig().init();<span class="Apple-tab-span"
 style="white-space:pre">        </span>/* initializes openSAML library, returns boolean */</span></div><div style="background-color: transparent;"><span>SAMLConfig::getConfig().term();<span class="Apple-tab-span" style="white-space:pre">        </span>/* terminates openSAML library, returns nothing */<br></span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;"><span><br></span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;"><span>Best,</span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;"><span>Akshay</span></div><div
 class="yahoo_quoted" style="display: block;"> <br> <br> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> On Thursday, 12 December 2013 7:41 PM, "Cantor, Scott" &lt;cantor.2@osu.edu&gt; wrote:<br> </font> </div>  <div class="y_msg_container">On 12/12/13, 5:20 PM, "Akshay Singh" &lt;<a shape="rect" ymailto="mailto:akshay_iiit@yahoo.com" href="mailto:akshay_iiit@yahoo.com">akshay_iiit@yahoo.com</a>&gt; wrote:<br clear="none"><br clear="none">&gt;I need to unmarshall a SAML assertion which I get from a web-service.<br clear="none">&gt;Since there is not much documentation on the internet for the C++ version<br clear="none">&gt;of openSAML, I looked in to the samltest (in source code) to find out how<br clear="none">&gt;to unmarshall/parse a SAML
 response.<br clear="none"><br clear="none">That's the only real source of simple examples.<br clear="none"><br clear="none">&gt;I understand I am trying to downcast an object pointer, which is not<br clear="none">&gt;guaranteed to work. But then this is the way it is being done in samltest<br clear="none">&gt;tests (samltest/saml2/core/impl/Assertion20Test.h).<br clear="none">&gt; Am I missing something?<br clear="none"><br clear="none">At a quick glance, your code is doing a couple of things wrong:<br clear="none"><br clear="none">- don't initialize Xerces, the library does that<br clear="none">- you aren't initializing OpenSAML, just XMLTooling<br clear="none"><br clear="none">The object registrations are not happening for the SAML object types, so<br clear="none">you're getting back a generic object of whatever the default type is,<br clear="none">usually UnknownXMLObject.<br clear="none"><br clear="none">OpenSAML will initialize XMLTooling in most
 cases, so calling its<br clear="none">configuration methods is usually sufficient.<br clear="none"><br clear="none">-- Scott<div class="yqt0735896451" id="yqtfd10797"><br clear="none"><br clear="none"><br clear="none">--<br clear="none">To unsubscribe from this list send an email to <a shape="rect" ymailto="mailto:dev-unsubscribe@shibboleth.net" href="mailto:dev-unsubscribe@shibboleth.net">dev-unsubscribe@shibboleth.net</a><br clear="none"></div><br><br></div>  </div> </div>  </div> </div></body></html>