Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The prefix "xs" for element "xs:schema" is not bound

Following is the xsd that i am trying to use while generating a client for SOAP Service, Eclipse is throwing an error : The prefix "xs" for element "xs:schema" is not bound.

<xs:schema version="1.0" 
           targetNamespace="bdo.com.ph/RemitAPI">
  <xs:element name="CheckServiceResponse" 
              nillable="true" type="xs:string"/>
  <xs:element name="apiRequest" nillable="true" type="tns:APIRequest"/>
  .............................
      <xs:element name="referenceNo" type="xs:string" form="qualified"/>
    </xs:sequence>
  </xs:complexType>
</xs:schema> 

I got this xsd from a webservice

like image 744
Aditya Avatar asked Jan 30 '13 17:01

Aditya


People also ask

What is Xs in XML schema?

1.1 The Schema Namespace ( xs ) The XML representation of schema components uses a vocabulary identified by the namespace name http://www.w3.org/2001/XMLSchema . For brevity, the text and examples in this specification use the prefix xs: to stand for this namespace; in practice, any prefix can be used.

What is XS schema xmlns XS?

xs:schema is the document (root) element of any W3C XML Schema. It's both a container for all the declarations and definitions of the schema and a place holder for a number of default values expressed as attributes.


2 Answers

 xmlns:xs="http://www.w3.org/2001/XMLSchema"  

was not added in the Schema XSD. adding it made me proceed to the next step.

xmlns:tns="http://www.bdo.com.ph/RemitAPI  

was not there in the XSD, though it was present in the enclosing WSDL.

When extracting an XSD from a WSDL to local machine, the namespace references in the XSD do not get picked up from the WSDL, they need to be declared in the XSD.

like image 56
Aditya Avatar answered Nov 15 '22 02:11

Aditya


This happens mainly because of the missing namespacedeclaration.

   "<elem "namespace" ..xsi:nil=true.>"

will work. Basically the XML validator expects a namespace to validate against.

like image 41
Vreddhi Bhat Avatar answered Nov 15 '22 01:11

Vreddhi Bhat