The prefix “xs” for element “xs:schema” is not bound

只谈情不闲聊 提交于 2019-12-04 23:58:44

问题


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


回答1:


 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.




回答2:


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.



来源:https://stackoverflow.com/questions/14609971/the-prefix-xs-for-element-xsschema-is-not-bound

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!