|
Re: CVC-complex-type.5.2 error message that nobody seems to be able to understand... [message #720972 is a reply to message #720955] |
Wed, 31 August 2011 15:17 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Casey,<br>
<br>
My guess would be that the XML Schema definition for Policy
element's complex type already defines an attribute called "Id"
that's meant to be the ID for that type. It likely also defines a
wildcard that allows you to include attributes from other
namespaces, so superficially, wsu:Id would seem like a valid thing
to include. <br>
<blockquote>wsu:Id="UsernameTokenSecurityPolicyPasswordOptional"<br>
</blockquote>
But, it's not valid for there to be more than one ID so the
validator isn't happy you're using a ID attribute from some other
namespace. Why don't you use this?<br>
<blockquote>Id="UsernameTokenSecurityPolicyPasswordOptional"<br>
</blockquote>
<br>
On 31/08/2011 7:39 AM, caseyburk wrote:
<blockquote cite="mid:j3lgei$jme$1@news.eclipse.org" type="cite">I'm
trying to import a WSDL file into a project (Eclipse Indigo /
Dynamic Web Project) but keep receiving an error indicator next to
the "wsp:Policy" line of the WSDL file:
<br>
<br>
Quote:
<br>
<blockquote type="cite">cvc-complex-type.5.2: In element
'wsp:Policy', attribute 'Id' is a Wild ID. But there is already
an attribute 'Id' derived from ID among the {attribute uses}.
<br>
</blockquote>
<br>
<br>
Here's the code of my WSDL file:
<br>
<br>
<?xml version='1.0' encoding='UTF-8'?>
<br>
<wsdl:definitions xmlns:soap=<a class="moz-txt-link-rfc2396E" href="http://schemas.xmlsoap.org/wsdl/soap/">"http:
//schemas.xmlsoap.org/wsdl/soap/"</a> xmlns:tns=<a class="moz-txt-link-rfc2396E" href="http://www.education.edu/department/client/MemberCheck">"http:
//www.education.edu/department/client/MemberCheck"</a>
xmlns:xsd="http: //www.w3.org/2001/XMLSchema"
xmlns:wsdl="http: //schemas.xmlsoap.org/wsdl/"
xmlns:wsp="http: //schemas.xmlsoap.org/ws/2002/12/policy"
xmlns:wsu=<a class="moz-txt-link-rfc2396E" href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">"http:
//docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"</a><br>
targetNamespace=<a class="moz-txt-link-rfc2396E" href="http://www.education.edu/department/client/MemberCheck">"http:
//www.education.edu/department/client/MemberCheck"</a>
name="MemberCheck">
<br>
<wsp:UsagePolicy wsdl:Required="true" />
<br>
<wsdl:types>
<br>
<xsd:schema xmlns:tns=<a class="moz-txt-link-rfc2396E" href="http://www.education.edu/department/client/MemberCheck">"http:
//www.education.edu/department/client/MemberCheck"</a>
xmlns:xsd="http: //www.w3.org/2001/XMLSchema" version="1.0"
targetNamespace=<a class="moz-txt-link-rfc2396E" href="http://www.education.edu/department/client/MemberCheck">"http:
//www.education.edu/department/client/MemberCheck"</a>>
<br>
<xsd:element name="checkMemberRequest"
type="tns:checkMemberRequest" />
<br>
<xsd:element name="checkMemberResponse"
type="tns:checkMemberResponse" />
<br>
<xsd:complexType name="checkMemberRequest">
<br>
<xsd:sequence>
<br>
<xsd:choice>
<br>
<xsd:element name="memberId" type="xsd:string" />
<br>
<xsd:element name="memberMatch"
type="tns:memberMatch" />
<br>
</xsd:choice>
<br>
</xsd:sequence>
<br>
</xsd:complexType>
<br>
<xsd:complexType name="memberMatch">
<br>
<xsd:sequence>
<br>
<xsd:element name="dateOfBirth" type="xsd:date"
minOccurs="0" />
<br>
<xsd:element name="degree" type="xsd:string"
minOccurs="0" />
<br>
<xsd:element name="yearGraduated" type="xsd:string"
minOccurs="0" />
<br>
<xsd:element name="firstYearAttended"
type="xsd:string" minOccurs="0" />
<br>
<xsd:element name="lastYearAttended" type="xsd:string"
minOccurs="0" />
<br>
<xsd:element name="ssnLast4" type="xsd:string"
minOccurs="0" />
<br>
<xsd:element name="previousSchool" type="xsd:string"
minOccurs="0" />
<br>
<xsd:element name="memberId" type="xsd:string"
minOccurs="0" />
<br>
<xsd:element name="firstName" type="xsd:string"
minOccurs="0" />
<br>
<xsd:element name="lastName" type="xsd:string"
minOccurs="0" />
<br>
<xsd:element name="middleName" type="xsd:string"
minOccurs="0" />
<br>
<xsd:element name="custom" type="tns:customData"
minOccurs="0" maxOccurs="unbounded" />
<br>
</xsd:sequence>
<br>
</xsd:complexType>
<br>
<xsd:complexType name="customData">
<br>
<xsd:sequence>
<br>
<xsd:element name="name" type="xsd:string" />
<br>
<xsd:element name="value" type="xsd:string" />
<br>
</xsd:sequence>
<br>
</xsd:complexType>
<br>
<xsd:complexType name="checkMemberResponse">
<br>
<xsd:sequence>
<br>
<xsd:element name="memberId" type="xsd:string"
minOccurs="0" />
<br>
<xsd:element name="memberStatus"
type="tns:memberStatus" />
<br>
<xsd:element name="memberStatusMessage"
type="xsd:string" />
<br>
<xsd:element name="ude"
type="tns:userDefinedExtension" minOccurs="0" />
<br>
</xsd:sequence>
<br>
</xsd:complexType>
<br>
<xsd:simpleType name="memberStatus">
<br>
<xsd:restriction base="xsd:string">
<br>
<xsd:enumeration value="NOMATCH" />
<br>
<xsd:enumeration value="TRAP" />
<br>
<xsd:enumeration value="OK" />
<br>
</xsd:restriction>
<br>
</xsd:simpleType>
<br>
<xsd:complexType name="userDefinedExtension">
<br>
<xsd:sequence>
<br>
<xsd:any namespace="##other"
processContents="lax"/>
<br>
</xsd:sequence>
<br>
</xsd:complexType>
<br>
</xsd:schema>
<br>
</wsdl:types>
<br>
<wsdl:message name="checkMemberRequest">
<br>
<wsdl:part name="parameters"
element="tns:checkMemberRequest" />
<br>
</wsdl:message>
<br>
<wsdl:message name="checkMemberResponse">
<br>
<wsdl:part name="parameters"
element="tns:checkMemberResponse" />
<br>
</wsdl:message>
<br>
<wsdl:portType name="MemberCheck">
<br>
<wsdl:operation name="checkMember">
<br>
<wsdl:input message="tns:checkMemberRequest" />
<br>
<wsdl:output message="tns:checkMemberResponse" />
<br>
</wsdl:operation>
<br>
</wsdl:portType>
<br>
<wsdl:binding name="MemberCheckPortBinding"
type="tns:MemberCheck">
<br>
<soap:binding transport=<a class="moz-txt-link-rfc2396E" href="http://schemas.xmlsoap.org/soap/http">"http:
//schemas.xmlsoap.org/soap/http"</a>
<br>
style="document" />
<br>
<wsdl:operation name="checkMember">
<br>
<soap:operation soapAction="" style="document" />
<br>
<wsp:Policy
wsu:Id="UsernameTokenSecurityPolicyPasswordOptional">
<br>
<wsp:ExactlyOne>
<br>
<wsp:All>
<br>
<wsse:SecurityToken wsp:Usage="wsp:Required"
<br>
xmlns:wsse=<a class="moz-txt-link-rfc2396E" href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">"http:
//docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"</a>><br>
<wsse:TokenType>wsse:UserNameToken</wsse:TokenType>
<br>
<Claims>
<br>
<SubjectName MatchType="wsse:Exact" />
<br>
<UsePassword wsp:Usage="wsp:Optional" />
<br>
</Claims>
<br>
</wsse:SecurityToken>
<br>
</wsp:All>
<br>
</wsp:ExactlyOne>
<br>
</wsp:Policy>
<br>
<wsdl:input>
<br>
<soap:body encodingStyle=<a class="moz-txt-link-rfc2396E" href="http://schemas.xmlsoap.org/soap/encoding/">"http:
//schemas.xmlsoap.org/soap/encoding/"</a> use="literal" />
<br>
</wsdl:input>
<br>
<wsdl:output>
<br>
<soap:body encodingStyle=<a class="moz-txt-link-rfc2396E" href="http://schemas.xmlsoap.org/soap/encoding/">"http:
//schemas.xmlsoap.org/soap/encoding/"</a> use="literal" />
<br>
</wsdl:output>
<br>
</wsdl:operation>
<br>
</wsdl:binding>
<br>
<wsdl:service name="MemberCheck">
<br>
<wsdl:port name="MemberCheckPort"
binding="tns:MemberCheckPortBinding">
<br>
<soap:address location=<a class="moz-txt-link-rfc2396E" href="http://www.education.edu:9999/department/client/MemberCheck">"http:
//www.education.edu:9999/department/client/MemberCheck"</a> />
<br>
</wsdl:port>
<br>
</wsdl:service>
<br>
</wsdl:definitions>
<br>
<br>
Again, I think the culprit code in question here is the following
line: <wsp:Policy
wsu:Id="UsernameTokenSecurityPolicyPasswordOptional">
<br>
<br>
I'm not sure what's causing this, but for whatever it's worth, it
seems that the people I've consulted about it believes that
there's something involved here that coincides with either the
version of DTD / schema being used or something else to do with
implied arguments that are defined in said DTDs as originally
expecting a fewer amount of parameters.
<br>
<br>
Anyway, if someone could help me out with this, I'd be forever in
your debt.
<br>
<br>
(Note that the definitions of schema / DTDs, etc. have a space
character between the colon and the first slash of the URI. I did
this due to how this bulletin board thought I was trying to post
spam.)
<br>
</blockquote>
</body>
</html>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
|
|
Re: CVC-complex-type.5.2 error message that nobody seems to be able to understand... [message #722139 is a reply to message #722023] |
Sun, 04 September 2011 16:09 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I totally disagree that it's a bug in anything. It's simply correct
schema validation as produced by Xerces. See
<a class="moz-txt-link-freetext" href="http://www.w3.org/TR/xmlschema-1/#cvc-complex-type">http://www.w3.org/TR/xmlschema-1/#cvc-complex-type</a> section 5.2<br>
<blockquote>
<div class="clnumber">5 Let <span class="termdef"><a id="key-ida"
name="key-ida">[Definition:] </a>the <b>wild
IDs</b> be the set of all
attribute information item to which clause <a
href="http://www.w3.org/TR/xmlschema-1/#c-avaw">3.2</a>
applied and whose <a class="termref"
href="http://www.w3.org/TR/xmlschema-1/#key-vn"><span
class="arrow">·</span>validation<span class="arrow">·</span></a>
resulted in
a <a class="termref"
href="http://www.w3.org/TR/xmlschema-1/#key-dd"><span
class="arrow">·</span>context-determined declaration<span
class="arrow">·</span></a> of
<i>mustFind</i> or no <a class="termref"
href="http://www.w3.org/TR/xmlschema-1/#key-dd"><span
class="arrow">·</span>context-determined
declaration<span class="arrow">·</span></a> at all, and
whose <a class="xpropref"
href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">[local
name]</a> and <a class="xpropref"
href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">[namespace
name]</a> resolve (as defined by <a
href="http://www.w3.org/TR/xmlschema-1/#cvc-resolve-instance">QName
resolution (Instance) (§3.15.4)</a>) to an attribute
declaration whose <a class="propref"
href="http://www.w3.org/TR/xmlschema-1/#a-simple_type_definition">{type
definition}</a> is or is derived from <a
href="http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#ID">ID</a></span>.
Then <b>all</b> of the following must be true:
<div class="constraintlist">
<div class="clnumber">5.1 There must be no more than one item
in <a class="termref"
href="http://www.w3.org/TR/xmlschema-1/#key-ida"><span
class="arrow">·</span>wild IDs<span class="arrow">·</span></a>.</div>
<div class="clnumber">5.2 If <a class="termref"
href="http://www.w3.org/TR/xmlschema-1/#key-ida"><span
class="arrow">·</span>wild IDs<span class="arrow">·</span></a>
is non-empty, there must not be any attribute uses among the
<a class="propref"
href="http://www.w3.org/TR/xmlschema-1/#ct-attribute_declarations">{attribute
uses}</a> whose <a class="propref"
href="http://www.w3.org/TR/xmlschema-1/#attribute">{attribute
declaration}</a>'s <a class="propref"
href="http://www.w3.org/TR/xmlschema-1/#a-simple_type_definition">{type
definition}</a> is or is derived from <a
href="http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#ID">ID</a>.</div>
</div>
<div class="note"><b>Note: </b>This clause serves to ensure that
even via attribute
wildcards no element has more than one attribute of type ID,
and that even when
an element legitimately lacks a declared attribute of type ID,
a
wildcard-validated attribute must not supply it. That is, if
an element has a
type whose attribute declarations include one of type ID, it
either has that
attribute or no attribute of type ID.</div>
</div>
<div class="note"><b>Note: </b>When an <a class="propref"
href="http://www.w3.org/TR/xmlschema-1/#ct-attribute_wildcard">{attribute
wildcard}</a> is present, this does
<em>not</em> introduce any ambiguity with respect to how
attribute
information items for
which an attribute use is present amongst the <a
class="propref"
href="http://www.w3.org/TR/xmlschema-1/#ct-attribute_declarations">{attribute
uses}</a> whose name and target namespace match are <a
class="termref"
href="http://www.w3.org/TR/xmlschema-1/#key-va"><span
class="arrow">·</span>assessed<span class="arrow">·</span></a>.
In such cases the attribute use <em>always</em> takes
precedence, and the <a class="termref"
href="http://www.w3.org/TR/xmlschema-1/#key-va"><span
class="arrow">·</span>assessment<span class="arrow">·</span></a>
of such items stands or falls entirely on the basis of the
attribute use and its <a class="propref"
href="http://www.w3.org/TR/xmlschema-1/#attribute">{attribute
declaration}</a>. This follows from the details of clause <a
href="http://www.w3.org/TR/xmlschema-1/#c-aam">3</a>.</div>
</blockquote>
Nothing in the XML Schema specification spells out "overloading" as
you've described it. There's just no such concept. The example
clearly violates 5.2 because the namespace of the Id attribute is
one different from that specified in the schema so it matches the
wildcard, not the locally defined attribute.<br>
<br>
Looking at your other thread, of course making the attribute match
the expected namespace fixes the problem. The comment about
removing
<blockquote><span class="MsgBodyText"><span>
<pre>xmlns:wsu="<LOCATION>/oasis-200401-wss-wssecurity-utility-1.0.xsd"</pre>
</span></span></blockquote>
must not be entirely accurate because without an xmlns declaration
for wsu, the XML isn't well formed.<br>
<br>
On 03/09/2011 9:10 PM, cu2sr wrote:
<blockquote cite="mid:j3ut3h$ofj$1@news.eclipse.org" type="cite">For
what it's worth, I believe this to be an issue with WSDL4J code
that validates the WSDL. My $.02 is it should be treating what you
have as an overloaded parameter - see the same named parameter and
replace the namespace with what's defined in your WSDL. Instead,
it sees a new namespace and thinks you're trying to add a new
parameter - one that's the same name. Anyway, you can follow a
similar conversation
<a class="moz-txt-link-abbreviated" href="http://www.eclipse.org/forums/index.php/mv/msg/224122/720694/">www.eclipse.org/forums/index.php/mv/msg/224122/720694/</a>
<br>
</blockquote>
</body>
</html>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.09137 seconds