I have a WSDL file that also contains all the types used in it (via the <wsdl:types> tag). When defining types, I have something like this:
<wsdl:definitions name="service" targetNamespace="http://www.xxx.yyy/reg/definitions" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tax="http://www.xxx.yyy/reg/definitions" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> ............. <xs:complexType name="CompanyName"> <xs:sequence> <xs:element name="Name" type="xs:string" /> <xs:element name="ShortName" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="Language" type="tax:LanguageType" use="required"/> <xs:assert test="ShortName or @Language != 'Language1'"/> </xs:complexType> ............. </wsdl:definitions>
Unfortunately, it does not work, giving the following exception when I try to run the application on Tomcat:
javax.xml.ws.WebServiceException: org.xml.sax.SAXParseException; s4s-elt-invalid-content.1: The content of 'CompanyName' is invalid. Element 'assert' is invalid, misplaced, or occurs too often.
The WSDL version is 1.2, and I donβt know which version of xsd it uses when the types are described in it, so I donβt know if this is an xsd problem (1.0 vs. 1.1) or something else.
Can someone help me find a real problem?
EDIT: I added the wsdl header. I added the version attribute ( version="1.1" ) to <xs:schema> but this did not help:
<xs:schema targetNamespace="http://www.xxx.yyy/reg/definitions" elementFormDefault="qualified" version="1.1">
source share