xml - 元素 "xsd"的前缀 "xsd:schema"未绑定(bind)

标签 xml xsd wsdl syntax-error xml-error

我收到了这个 WSDL,但我遇到了 XSD 问题。

我似乎无法在我的 XSD 文件中找到问题。

什么没有绑定(bind)? 我该如何解决这个问题?

error: The prefix "xsd" for element "xsd:schema" is not bound.

这是 XSD 文件的一部分:

 <xsd:schema targetNamespace="http://www.informatica.com/wsdl/"
             elementFormDefault="qualified"
             attributeFormDefault="unqualified"
             xmlns="http://www.informatica.com/wsdl/"
             xmlns:infatype="http://www.informatica.com/types/">
      <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/http/"/>
         <xsd:element name="SHA003Bis_GetArticleDataResponse"
                      type="SHA003Bis_GetArticleDataResponseType"/>
         <xsd:element name="SHA003Bis_GetArticleDataRequest"
                      type="SHA003Bis_GetArticleDataRequestType"/>
         <xsd:complexType name="SHA003Bis_GetArticleDataRequestType">
            <xsd:sequence>
               <xsd:element name="SHA003Bis_GetArticleDataRequestElement">
                  <xsd:complexType>
                     <xsd:sequence>
                        <xsd:element name="Company" minOccurs="0" maxOccurs="1">
                           <xsd:simpleType>
                              <xsd:restriction base="xsd:integer"/>
                           </xsd:simpleType>
                        </xsd:element>

这是 WSDL 的一部分:

<wsdl:definitions targetNamespace="http://www.informatica.com/" 
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
                  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
                  xmlns:n="http://www.informatica.com/wsdl/" 
                  xmlns:infa="http://www.informatica.com/" 
                  xmlns="http://schemas.xmlsoap.org/wsdl/">
   <wsdl:types>
      <xsd:schema targetNamespace="http://www.informatica.com/wsdl/"
                  elementFormDefault="qualified"
                  attributeFormDefault="unqualified"
                  xmlns="http://www.informatica.com/wsdl/"
                  xmlns:infatype="http://www.informatica.com/types/">
         <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/http/"/>
         <xsd:element name="SHA003Bis_GetArticleDataResponse"
                      type="SHA003Bis_GetArticleDataResponseType"/>
         <xsd:element name="SHA003Bis_GetArticleDataRequest"
                      type="SHA003Bis_GetArticleDataRequestType"/>
         <xsd:complexType name="SHA003Bis_GetArticleDataRequestType">
            <xsd:sequence>
               <xsd:element name="SHA003Bis_GetArticleDataRequestElement">
                  <xsd:complexType>
                     <xsd:sequence>
                        <xsd:element name="Company" minOccurs="0" maxOccurs="1">
                           <xsd:simpleType>
                              <xsd:restriction base="xsd:integer"/>
                           ...

最佳答案

xmlns:xsd="http://www.w3.org/2001/XMLSchema" 添加到 XSD 的根元素中:

  <xsd:schema targetNamespace="http://www.informatica.com/wsdl/"
              elementFormDefault="qualified" 
              attributeFormDefault="unqualified" 
              xmlns="http://www.informatica.com/wsdl/" 
              xmlns:infatype="http://www.informatica.com/types/"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema">

这样它就可以独立于包装器之外。

关于xml - 元素 "xsd"的前缀 "xsd:schema"未绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32633473/

相关文章:

maven - cxf-codegen-plugin 排除 XSD 文件

eclipse - XSD 类型定义是否在编译时验证?

soap - 在哪里可以找到 gSOAP 生成的 WSDL 文件

XML 错误与(字符串)错误

用于将 xml 解析为不带命名空间的节点的数组的 PHP 函数

java - 根据 XSD 验证 XML 顺序的框架

c# - 无法为 wsdl 文件创建服务引用

java - android-bitmap 低质量问题

带时区的 XML 日期时间

xml - 在 ISS-UI AATS 2016 网站上寻找示例 IRS AIR XML 文件