Marshalling RequestSecurityToken

Brent Putman putmanb at georgetown.edu
Fri Mar 16 17:05:50 GMT 2012



On 3/16/12 11:00 AM, Gina Choi wrote:
> I used following code to build RequestSecurityToken(Please let me know if I
> am in wrong direction). In same way, I was able to find corresponding
> builders for each element inside RequestSecurityToken.
>
> 	//Build RequestSecurityToken
> 	RequestSecurityTokenBuilder rstBuilder = new
> RequestSecurityTokenBuilder();


Well, that's not really correct either.  It "works", but is not how the
library is intended to be used.  You should always obtain builders,
marshallers and unmarshallers from the factories that are exposed by the
Configuration singleton.  See this page in the wiki for the builder
examples:

https://wiki.shibboleth.net/confluence/display/OpenSAML/OSTwoUsrManJavaCreateFromScratch




> 	
>
> I guess next step is that I need to put this RST inside SOAP envelope, but I
> haven't deal with SOAP much before. Any ideas?


The SOAP support in OpenSAML is very low-level.  You just build an
Envelope object, then create a Body and add it to the Envelope; and
inside the Body you put your payload (e.g. the RST).  If you need
headers (as you almost certainly will with any of this WS-* stuff), then
you create a Header and add it to the Envelope, and then add the various
header objects as children of the Header.  This is illustrated by the
SOAP client example in the wiki that I previously sent:

https://wiki.shibboleth.net/confluence/display/OpenSAML/OSTwoUserManJavaSOAPClientExample




More information about the dev mailing list