Issue with xmltooling and attribute namespace

Brent Putman putmanb at georgetown.edu
Wed Feb 26 19:54:15 EST 2014


On 2/26/14 10:48 AM, Massimiliano Masi wrote:
> Hi, 
>
> I somehow fixed it. I was using as a reference for my class the
> RequestSecurityToken. By using the saml2's Attribute class as a template, 
> it works properly. Thus, my classes do not extend
> AbstractWSTrustObject, but AbstractSAMLObject.

There's not really any significant difference betwween those, we just
liked having distinct abstract classes in case in the future there might
be a reason to override behavior.  Actually, all that WS-Trust code was
contributed by a third-party, for what it's worth.

Actually, in fact, your stuff is probably neither of those, if it's a
custom schema.  Those classes are for components implementing those
formal specs/schemas.  You'd probably just want to extend
AbstractValidatingXMLObject.  Or invent your own superclasses as
extensions of that, if you want to be formal about it. 



> The same for the marshaller and unmarshaller. 
> For each attribute I used the prepareForAssignment instead of adding
> it as unkownAttribute.add().

Yes, that sounds correct.  Based on your schema snippet of:


  <xs:elementname="ClaimType"type="ts:ClaimTypeType"/>

    <xs:complexTypename="ClaimTypeType">

        <xs:attributename="DataType"type="xs:anyURI"use="required"  />

        <xs:attributename="name"type="xs:anyURI"use="required"/>

    </xs:complexType>



you have neither wildcard element children (via <xs:any>) nor wildcard
attributes (via <xs:anyAttribute>).  So you shouldn't be doing anything
with unknownAttributes, etc.  You just have 2 attributes on that custom
type, so you should just have 2 getter/setter pairs in the interface for
those.  The handling for those in the marshaller and unmarshaller should
be straight-forward.

>
> I used getters and setters instead of the AbstractWSTrustObject
> getUnknownXMLElements().add().

AbstractWSTrustObject doesn't have anything like that so I don't know
what you mean.  It's a very high level superclass.  Perhaps you mean
some specific subclass of that in the 'wstrust' package that you were
using as an example.  A lot of the things in the WS-Trust and
WS-Security schemas makes heavy use of wildcard elements and/or
attributes, but if you don't have those in your custom schema then you
shouldn't just blindly copy those.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/dev/attachments/20140226/aab19bc1/attachment.html 


More information about the dev mailing list