<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-cite-prefix">On 2/26/14 10:48 AM, Massimiliano Masi
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAEj0woSrGGcA_S5C_CcU039uVXmAaPeSdZB89iu4iotQicRgLA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi,&nbsp;
        <div><br>
        </div>
        <div>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,&nbsp;</div>
        <div>it works properly. Thus, my classes do not extend
          AbstractWSTrustObject, but AbstractSAMLObject. </div>
      </div>
    </blockquote>
    <br>
    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.&nbsp; Actually, all that
    WS-Trust code was contributed by a third-party, for what it's worth.<br>
    <br>
    Actually, in fact, your stuff is probably neither of those, if it's
    a custom schema.&nbsp; Those classes are for components implementing
    those formal specs/schemas.&nbsp; You'd probably just want to extend
    AbstractValidatingXMLObject.&nbsp; Or invent your own superclasses as
    extensions of that, if you want to be formal about it.&nbsp; <br>
    <br>
    <br>
    <br>
    <blockquote
cite="mid:CAEj0woSrGGcA_S5C_CcU039uVXmAaPeSdZB89iu4iotQicRgLA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>The same for the marshaller and unmarshaller.&nbsp;</div>
        <div>For each attribute I used the prepareForAssignment instead
          of adding it as unkownAttribute.add().</div>
      </div>
    </blockquote>
    <br>
    Yes, that sounds correct.&nbsp; Based on your schema snippet of:<br>
    <br>
    <div><br>
    </div>
    <div>
      <p
style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(57,51,255)"><span
          style="color:rgb(0,0,0)">&nbsp;&nbsp;</span><span
          style="color:rgb(0,145,147)">&lt;</span><span
          style="color:rgb(78,145,146)">xs:element</span><span
          style="color:rgb(0,0,0)"> </span><span
          style="color:rgb(147,33,146)">name</span><span
          style="color:rgb(0,0,0)">=</span>"ClaimType"<span
          style="color:rgb(0,0,0)"> </span><span
          style="color:rgb(147,33,146)">type</span><span
          style="color:rgb(0,0,0)">=</span>"ts:ClaimTypeType"<span
          style="color:rgb(0,145,147)">/&gt;</span></p>
      <p
style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(57,51,255)"><span
          style="color:rgb(0,0,0)">&nbsp; &nbsp; </span><span
          style="color:rgb(0,145,147)">&lt;</span><span
          style="color:rgb(78,145,146)">xs:complexType</span><span
          style="color:rgb(0,0,0)"> </span><span
          style="color:rgb(147,33,146)">name</span><span
          style="color:rgb(0,0,0)">=</span>"ClaimTypeType"<span
          style="color:rgb(0,145,147)">&gt;</span></p>
      <p
style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(57,51,255)"><span
          style="color:rgb(0,0,0)">&nbsp; &nbsp; &nbsp; &nbsp; </span><span
          style="color:rgb(0,145,147)">&lt;</span><span
          style="color:rgb(78,145,146)">xs:attribute</span><span
          style="color:rgb(0,0,0)"> </span><span
          style="color:rgb(147,33,146)">name</span><span
          style="color:rgb(0,0,0)">=</span>"DataType"<span
          style="color:rgb(0,0,0)"> </span><span
          style="color:rgb(147,33,146)">type</span><span
          style="color:rgb(0,0,0)">=</span>"xs:anyURI"<span
          style="color:rgb(0,0,0)"> </span><span
          style="color:rgb(147,33,146)">use</span><span
          style="color:rgb(0,0,0)">=</span>"required"<span
          style="color:rgb(0,0,0)">&nbsp; </span><span
          style="color:rgb(0,145,147)">/&gt;</span></p>
      <p
style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(57,51,255)"><span
          style="color:rgb(0,0,0)">&nbsp; &nbsp; &nbsp; &nbsp; </span><span
          style="color:rgb(0,145,147)">&lt;</span><span
          style="color:rgb(78,145,146)">xs:attribute</span><span
          style="color:rgb(0,0,0)"> </span><span
          style="color:rgb(147,33,146)">name</span><span
          style="color:rgb(0,0,0)">=</span>"name"<span
          style="color:rgb(0,0,0)"> </span><span
          style="color:rgb(147,33,146)">type</span><span
          style="color:rgb(0,0,0)">=</span>"xs:anyURI"<span
          style="color:rgb(0,0,0)"> </span><span
          style="color:rgb(147,33,146)">use</span><span
          style="color:rgb(0,0,0)">=</span>"required"<span
          style="color:rgb(0,0,0)"> </span><span
          style="color:rgb(0,145,147)">/&gt;</span></p>
      <p
style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(78,145,146)"><span
          style="color:rgb(0,0,0)">&nbsp; &nbsp; </span><span
          style="color:rgb(0,145,147)">&lt;/</span>xs:complexType<span
          style="color:rgb(0,145,147)">&gt;</span></p>
    </div>
    <br>
    <br>
    you have neither wildcard element children (via &lt;xs:any&gt;) nor
    wildcard attributes (via &lt;xs:anyAttribute&gt;).&nbsp; So you shouldn't
    be doing anything with unknownAttributes, etc.&nbsp; You just have 2
    attributes on that custom type, so you should just have 2
    getter/setter pairs in the interface for those.&nbsp; The handling for
    those in the marshaller and unmarshaller should be straight-forward.<br>
    <br>
    <blockquote
cite="mid:CAEj0woSrGGcA_S5C_CcU039uVXmAaPeSdZB89iu4iotQicRgLA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>I used getters and setters instead of the
          AbstractWSTrustObject getUnknownXMLElements().add().</div>
      </div>
    </blockquote>
    <br>
    AbstractWSTrustObject doesn't have anything like that so I don't
    know what you mean.&nbsp; It's a very high level superclass.&nbsp; Perhaps you
    mean some specific subclass of that in the 'wstrust' package that
    you were using as an example.&nbsp; 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.<br>
    <br>
    <br>
    <br>
  </body>
</html>