<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/25/14 9:13 AM, Massimiliano Masi
wrote:<br>
</div>
<blockquote
cite="mid:CAEj0woQ4JDtWt4UySNVbk5Aw4z6GfkYPy-r+hq8jbwBTqcXrKQ@mail.gmail.com"
type="cite">
<div dir="ltr">Hi All,
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>In project A, my XMLObject is unmarshalled as: <br>
</div>
</div>
</blockquote>
<br>
My question would be: Unmarshalled from where? Coming in over the
wire from a WS service or WS client of some kind (e.g. see below re:
Apache Axis). OpenSAML doesn't change a DOM when it unmarshalls an
XMLObject tree around it, so my guess would be that the XML already
looks that way before it gets to your OpenSAML. Or else, it's being
mutated in some way by whatever DOM serialization you are applying.
But either way I don't think OpenSAML is directly involved.<br>
<br>
If you're pulling this off the wire, I'd try serializing and logging
it before you hand it to OpenSAML for unmarshalling, just to confirm
exactly what you are receiving.<br>
<br>
<blockquote
cite="mid:CAEj0woQ4JDtWt4UySNVbk5Aw4z6GfkYPy-r+hq8jbwBTqcXrKQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<p style="margin:0px;font-size:11px;font-family:Monaco"><br>
</p>
<div><br>
</div>
<div>Project A is good, since it declares a namespace for the
attributes DataType and Name, while in project B such
attribtues are not set. This violates this schema
definition: </div>
<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)"> </span><span
style="color:rgb(0,145,147)"><</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)">/></span></p>
<p
style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(57,51,255)"><span
style="color:rgb(0,0,0)"> </span><span
style="color:rgb(0,145,147)"><</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)">></span></p>
<p
style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(57,51,255)"><span
style="color:rgb(0,0,0)"> </span><span
style="color:rgb(0,145,147)"><</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)"> </span><span
style="color:rgb(0,145,147)">/></span></p>
<p
style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(57,51,255)"><span
style="color:rgb(0,0,0)"> </span><span
style="color:rgb(0,145,147)"><</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)">/></span></p>
<p
style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(78,145,146)"><span
style="color:rgb(0,0,0)"> </span><span
style="color:rgb(0,145,147)"></</span>xs:complexType<span
style="color:rgb(0,145,147)">></span></p>
</div>
<div><br>
</div>
</div>
</div>
</blockquote>
<br>
<br>
Actually, that's not really clear just from that schema snippet.
Whether the attributes in an instance document are
namespace-qualified or not depends (in part) on the
<xs:schema> element's '
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
attributeFormDefault' attribute. If it's absent, it defaults to
'unqualified'. Unless the schema is explicitly setting
'attributeFormDefault=qualified', then based on that schema snippet,
I believe the unqualified forms in your B example would be the
correct schema-valid ones. See also '
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
elementFormDefault' , which does the same for elements.<br>
<br>
Note that a lot of schemas, including SAML and WS-Trust, set (and/or
effectively default)
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
'elementFormDefault=qualified' and
'attributeFormDefault=unqualified', meaning elements will be
namespace-qualified, but attributes are not.<br>
<br>
(That doesn't really have anything to do with why you're seeing 2
different outputs, though).<br>
<br>
<br>
<br>
<blockquote
cite="mid:CAEj0woQ4JDtWt4UySNVbk5Aw4z6GfkYPy-r+hq8jbwBTqcXrKQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div><br>
</div>
<div>Since the code (from project A) is the same, it must be a
problem of libraries. Do you have suggestions?</div>
</div>
</div>
</blockquote>
<br>
Not specifically, but that ns0, ns1, etc stuff looks suspiciously
like what Apache Axis does when it generates Java code to handle a
particular schema (the "contract driven" way). So perhaps that is
relevant somewhere in what you are doing, or at least you are
somehow using some of the same libraries that they do.<br>
<br>
<br>
--Brent<br>
<br>
<br>
</body>
</html>