i am having the application which compiles the schema using JAXB /XJC. i would like to identify the real problem when we are about to deploying web service code in application server . here we are having the schema contains element which does have type causing issues. i want to check are we giving the right schema to the compiler. assume the xsd definition we given below. This cause problem. The real difference is the standard definition generated class files web service not get deployed. but if we remove the element entirely, the web service get deployed successfully. can any one please Guide me?
Problematic schema (According to w3schools )
<xsd:complexType name="PersonType">
<xsd:sequence>
<xsd:element name="nom" type="xsd:string" />
<xsd:element name="prenom" type="xsd:string" />
<xsd:element name="date_naissance" type="xsd:date" />
<xsd:element name="etablissement" type="xsd:string" />
<xsd:element name="num_tel" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="row" type="PersonType"/>
Working schema, (Webservice get deploying)
<xsd:complexType name="PersonType">
<xsd:sequence>
<xsd:element name="nom" type="xsd:string" />
<xsd:element name="prenom" type="xsd:string" />
<xsd:element name="date_naissance" type="xsd:date" />
<xsd:element name="etablissement" type="xsd:string" />
<xsd:element name="num_tel" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
You should define a namespace for your xsd and a prefix to use each complex type.
The XSD should be
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://yournamespace"
xmlns:your_prefix="http://yournamespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="PersonType">
<xsd:sequence>
<xsd:element name="nom" type="xsd:string" />
<xsd:element name="prenom" type="xsd:string" />
<xsd:element name="date_naissance" type="xsd:date" />
<xsd:element name="etablissement" type="xsd:string" />
<xsd:element name="num_tel" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="row" type="your_prefix:PersonType"/>
</xsd:schema>