前缀“xs"对于元素“xs:schema"不受约束 [英] The prefix "xs" for element "xs:schema" is not bound

查看:29
本文介绍了前缀“xs"对于元素“xs:schema"不受约束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我在为 SOAP 服务生成客户端时尝试使用的 xsd,Eclipse 抛出错误:未绑定元素xs:schema"的前缀xs".

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> 

我从网络服务中得到了这个 xsd

I got this xsd from a webservice

推荐答案

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

未添加到架构 XSD 中.添加它让我继续下一步.

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

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

虽然它存在于封闭的 WSDL 中,但它并不存在于 XSD 中.

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

当从 WSDL 提取 XSD 到本地机器时,XSD 中的命名空间引用不会从 WSDL 中获取,它们需要在 XSD 中声明.

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.

这篇关于前缀“xs"对于元素“xs:schema"不受约束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆