Class WSTrustElementFactory

  • Direct Known Subclasses:
    WSTrustElementFactoryImpl, WSTrustElementFactoryImpl

    public abstract class WSTrustElementFactory
    extends Object
    A Factory for creating the WS-Trust schema elements, and marshalling/un-marshalling them

    The default Implementation classes for all these WS-Trust schema Elements would assume that JAXB Bindings were generated for ws-trust.xsd schema in a particular fixed namespace/package. The default implementation classes for all these WS-Trust Element Interfaces would hence wrap the schema generated classes.

    An STS Service can create a RequestSecurityToken from the JAXBBean(i.e RequestSecurityTokenType) it receives, as an SEI method parameter, in the following manner

     RequestSecurityTokenType tok=...//obtained as JAXWS SEI method paramater
     ObjectFactory factory = new ObjectFactory();
     JAXBElement<RequestSecurityTokenType> rst= factory.createRequestSecurityToken(tok);
     WSTrustElementFactory fact= ..
     RequestSecurityToken requestSecurityToken= fact.createRSTFrom(rst);
     

    To get back a JAXB Bean from an instance of RequestSecurityToken the following can be done

     JAXBElement<RequestSecurityTokenType> elem = fact.toJAXBElement(requestSecurityToken);
     RequestSecurityTokenType tok = elem.getValue();
     

    Author:
    Kumar Jayanti