Hi, I am developing a WSDL file for a Web Service and I am having a problem with the XSD schema associated with this WSDL.

The Schema is below:

<wsdl:types>
  	<xsd:schema targetNamespace="SNIPPED">
  	
	  <!-- Classes de apoio -->

	  <xsd:simpleType name="resultadoOperacao" final="restriction">
	    <xsd:restriction base="xsd:string">
		  <xsd:enumeration value="OK"/>
		  <xsd:enumeration value="NOK"/>
		</xsd:restriction>
	  </xsd:simpleType>
	  
	  <xsd:simpleType name="resultadoConsulta" final="restriction">
	    <xsd:restriction base="xsd:string">
		  <xsd:enumeration value="OK"/>
		  <xsd:enumeration value="NOK(Y)"/>
		  <xsd:enumeration value="NOK(R)"/>
		  <xsd:enumeration value="NaoCadastrado"/>
		</xsd:restriction>
	  </xsd:simpleType>
	  
	  <xsd:simpleType name="dedoEnumeration" final="restriction" >
		<xsd:restriction base="xsd:string">
		  <xsd:enumeration value="PolegarDireito"/>
          <xsd:enumeration value="IndicadorDireito"/>
          <xsd:enumeration value="MedioDireito"/>
		  <xsd:enumeration value="AnelarDireito"/>
		  <xsd:enumeration value="MinimoDireito"/>
		  <xsd:enumeration value="PolegarEsquerdo"/>
		  <xsd:enumeration value="IndicadorEsquerdo"/>
		  <xsd:enumeration value="MedioEsquerdo"/>
		  <xsd:enumeration value="AnelarEsquerdo"/>
		  <xsd:enumeration value="MinimoEsquerdo"/>
		</xsd:restriction>
	  </xsd:simpleType>
	
	  <xsd:element name="digital">
	    <xsd:complexType>
		  <xsd:sequence>
		    <xsd:element name="imagem" type="xsd:hexBinary"/>
			<xsd:element name="templateANSI" type="xsd:hexBinary"/>
			<xsd:element name="template" type="xsd:hexBinary"/>
			<xsd:element name="dedo" type="dedoEnumeration"/>
		  </xsd:sequence>
		</xsd:complexType>
	  </xsd:element>
	  
	  <xsd:element name="incidencia">
	    <xsd:complexType>
		  <xsd:sequence>
		    <xsd:element name="CPF" type="xsd:string"/>
			<xsd:element name="status" type="xsd:string"/>
			<xsd:element name="score" type="xsd:double"/>
		  </xsd:sequence>
		</xsd:complexType>
	  </xsd:element>
	
	  <!-- Classes utilizadas diretamente pelas mensagens do Web Service -->
	  
  	  <xsd:element name="cadastrarRequest">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="CPF" type="xsd:string"/>
			<xsd:element name="dedos" type="digital" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:element name="funcionario" type="xsd:integer"/>
			<xsd:element name="origem" type="xsd:string"/>
			<xsd:element name="segmento" type="xsd:string"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
	  
	  <xsd:element name="cadastrarResponse">
	    <xsd:complexType>
		  <xsd:sequence>
		    <xsd:element name="resultadoCaptura" type="resultadoOperacao"/>
			<xsd:element name="descricao" type="xsd:string"/>
		  </xsd:sequence>
		</xsd:complexType>
	  </xsd:element>
      
      <xsd:element name="verificarRequest">
	    <xsd:complexType>
		  <xsd:sequence>
		    <xsd:element name="CPF" type="xsd:string"/>
		    <xsd:element name="dedo" type="digital"/>
		    <xsd:element name="origem" type="xsd:string"/>
		  </xsd:sequence>
		</xsd:complexType>
	  </xsd:element>
	  
	  <xsd:element name="verificarResponse">
	    <xsd:complexType>
		  <xsd:sequence>
		    <xsd:element name="resultadoCaptura" type="resultadoOperacao"/>
			<xsd:element name="resultadoVerificacao" type="resultadoOperacao"/>
		  </xsd:sequence>
		</xsd:complexType>
	  </xsd:element>
	  
	  <xsd:element name="SNIPPED">
	    <xsd:complexType>
		  <xsd:sequence>
		    <xsd:element name="CPF" type="xsd:string"/>
		    <xsd:element name="origem" type="xsd:string"/>
		  </xsd:sequence>
		</xsd:complexType>
	  </xsd:element>
	  
	  <xsd:element name="SNIPPED">
	    <xsd:complexType>
		  <xsd:sequence>
		    <xsd:element name="dedosCadastrados" type="digital" minOccurs="0" maxOccurs="unbounded"/>
		  </xsd:sequence>
		</xsd:complexType>
	  </xsd:element>
	  
	  <xsd:element name="consultaMatrizDeRegrasRequest">
	    <xsd:complexType>
		  <xsd:sequence>
		    <xsd:element name="CPF" type="xsd:string"/>
		  </xsd:sequence>
		</xsd:complexType>
	  </xsd:element>
			
	  <xsd:element name="consultaMatrizDeRegrasResponse">
	    <xsd:complexType>
		  <xsd:sequence>
		    <xsd:element name="resultado" type="resultadoConsulta"/>
		  </xsd:sequence>
		</xsd:complexType>
	  </xsd:element>
	  
	  <xsd:element name="SNIPPED">
	    <xsd:complexType>
		  <xsd:sequence>
		    <xsd:element name="CPF" type="xsd:string"/>
		  </xsd:sequence>
		</xsd:complexType>
	  </xsd:element>
	  
	  <xsd:element name="SNIPPED">
	    <xsd:complexType>
		  <xsd:sequence>
		    <xsd:element name="resultado" type="resultadoConsulta"/>
			<xsd:element name="listaIncidencias" type="incidencia" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:element name="numIncidencias" type="xsd:integer"/>
		  </xsd:sequence>
		</xsd:complexType>
	  </xsd:element>
	  
	  <xsd:element name="alteracaoRequest">
	    <xsd:complexType>
		  <xsd:sequence>
		    <xsd:element name="CPF" type="xsd:string"/>
			<xsd:element name="status" type="xsd:string"/>
			<xsd:element name="funcionario" type="xsd:integer"/>
		  </xsd:sequence>
		</xsd:complexType>
	  </xsd:element>
	  
	  <xsd:element name="alteracaoResponse">
	    <xsd:complexType>
		  <xsd:sequence>
		    <xsd:element name="resultadoAlteracao" type="resultadoOperacao"/>
		  </xsd:sequence>
		</xsd:complexType>
	  </xsd:element>
  		
  	</xsd:schema>
  </wsdl:types>

I am using eclipse to validate the schema and I am receiving the following error:

Description	Resource	Path	Location	Type
src-resolve.4.1: Error resolving component 'dedoEnumeration'. It was detected that 'dedoEnumeration' has no namespace, but components with no target namespace are not referenceable from schema document 'SNIPPED'. If 'dedoEnumeration' is intended to have a namespace, perhaps a prefix needs to be provided. If it is intended that 'dedoEnumeration' has no namespace, then an 'import' without a "namespace" attribute should be added to 'SNIPPED' line 30	WSDL Problem

What is wrong with my schema? How can I fix this error?

Thanks,
Komyg

Recommended Answers

All 2 Replies

Could you attach your schema? The problem is that you have included a simpletype "dedoenumeration" without a "namespace," which should be defined in your schema. In other words, the code you wrote may be fine on its own, but according to the schematic the server will not be able to use the parsed code you have written for it.

Hi, actually I discovered that the problem was with the following code:

<xsd:element name="digital">
	<xsd:complexType>
		<xsd:sequence>
			<xsd:element name="imagem" type="xsd:hexBinary"/>
			<xsd:element name="templateANSI" type="xsd:hexBinary"/>
			<xsd:element name="template" type="xsd:hexBinary"/>
			<xsd:element name="dedo" type="dedoEnumeration"/>
		</xsd:sequence>
	</xsd:complexType>
</xsd:element>

Once I altered it to:

<xsd:element name="digital" type="tns:digital"/>
<xsd:complexType name="digital">
	<xsd:sequence>
		<xsd:element name="imagem" type="xsd:hexBinary"/>
		<xsd:element name="templateANSI" type="xsd:hexBinary"/>
		<xsd:element name="template" type="xsd:hexBinary"/>
		<xsd:element name="dedo" type="dedoEnumeration"/>
	</xsd:sequence>
</xsd:complexType>

Everything worked fine.

Thanks,
Komyg

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.