You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Kiran Bhumana <kB...@SeeBeyond.com> on 2003/01/20 07:34:57 UTC

another Validation question

I Have two questions, 
 
1)
I get this following error. I understand the meaning of it, (or I think
so).
I have defined "slt" in the wsdl file.
 
[Error]:20:40: cvc-complex-type.2.4.a: Invalid content starting with
element 'slt:ser
viceLinkType'. The content must match
'(((("http://schemas.xmlsoap.org/wsdl/":documen
tation){0-1}),((WC[##other:"http://schemas.xmlsoap.org/wsdl/"]){0-UNBOUN
DED})),((("ht
tp://schemas.xmlsoap.org/wsdl/":import)|("http://schemas.xmlsoap.org/wsd
l/":types)|("
http://schemas.xmlsoap.org/wsdl/":message)|("http://schemas.xmlsoap.org/
wsdl/":portTy
pe)|("http://schemas.xmlsoap.org/wsdl/":binding)|("http://schemas.xmlsoa
p.org/wsdl/":
service)){0-UNBOUNDED}))'.
[Error]:20:40: cvc-complex-type.2.4.c: The matching wildcard is strict,
but no declar
ation can be found for element 'slt:serviceLinkType'.
 
 
<definitions targetNamespace="urn:wait:waitService"
             xmlns:tns="urn:wait:waitService"
 
xmlns:slt="http://schemas.xmlwsdl.org/ws/2002/07/service-link/"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns="http://schemas.xmlsoap.org/wsdl/"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/
http://schemas.xmlsoap.org/wsdl/wsdl.xsd">
<!-- http://schemas.xmlsoap.org/ws/2002/07/service-link/
http://schemas.xmlsoap.org/ws/2002/07/service-link.xsd" -->
 
   <message name="StringMessageType">
      <part name="waitString" type="xsd:string"/>
   </message>
 
   <portType name="waitPT">
      <operation name="wait">
         <input message="tns:StringMessageType"/>
         <output message="tns:StringMessageType"/>
      </operation>
   </portType>
 
   <slt:serviceLinkType name="waitSLT">
     <slt:role name="service">
       <slt:portType name="tns:waitPT"/>
     </slt:role>
   </slt:serviceLinkType>
 
   <!-- The service name and the TNS represent my service ID QName -->
   <service name="waitServiceBP">
   </service>
 
</definitions>
 
 
2) Can I pass the shema locations programmatically and remove them
completely from the xml file ?
   As per what I gathered, I thought we could, but it did not recognize
the schema.
 
 
Thanks,
Kiran

Re: another Validation question

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
Since you are validating the document against the wsdl schema, it must conform to the WSDL schema.  The root element, <definitions> must have element content of
<documentation>?,<import>* <types>? ,<message>*,<portType>*,<binding>*, <service>* (and, in WSDL 1.2, <serviceType>*).  No other element content is permitted.  At least one content element other than documentation must be present.  The various elements allowed as content may contain extension elements (outside the wsdl namespace) in certain parts of their content.

<import> is used to access either datatypes or wsdl elements (those listed above) held in other files.  In wsdl 1.2, no imported item may be in the targetNamespace of the wsdl definitions while wsdl 1.1 is looser. When <import> specifies a namespace, this means it is legal to refer to components from that namespace in the importing document.  The schema processor must also be able to find the declarations of those references, and uses the schema locations for this purpose (or a location attribute specified in <import>).

Jeff