Error: Illegal namespace for attribute declaration: http://www.w3.org/2001/XMLSchema-instance

Error: Illegal namespace for attribute declaration: http://www.w3.org/2001/XMLSchema-instance

我正在尝试通过导入 wsdl 在 SOAPUI 中创建一个新的 SOAP 项目。 wsdl 的初始部分如下所示:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wsdl:definitions targetNamespace="http://sap.com/xi/SAPGlobal20/Global" name="BusinessPartnerSUITEBulkReplicateRequestIn" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://sap.com/xi/SAPGlobal20/Global" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xs:schema targetNamespace="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:attribute type="xs:string" name="nil"/>
</xs:schema>
<xs:schema xmlns="http://sap.com/xi/SAP_BS_FND/MDG/Global2" targetNamespace="http://sap.com/xi/SAP_BS_FND/MDG/Global2" xmlns:ns1="http://ariba.com/xi/SupplierManagement" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified">
<xs:schema targetNamespace="http://ariba.com/xi/SupplierManagement" xmlns:tns="http://ariba.com/xi/SupplierManagement" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified" xmlns:mdg="http://sap.com/xi/SAP_BS_FND/MDG/Global2" xmlns:sapg20="http://sap.com/xi/SAPGlobal20/Global" xmlns:sm="http://ariba.com/xi/SupplierManagement" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xs:import namespace="http://sap.com/xi/SAP_BS_FND/MDG/Global2"/>
<xs:import namespace="http://www.w3.org/2001/XMLSchema-instance"/>
<xs:element type="tns:BPSUITEBulkRplctConfMsg" name="BusinessPartnerSUITEBulkReplicateConfirmationMessage"/>
<xs:element type="tns:BPSUITEBulkRplctReqMsg" name="BusinessPartnerSUITEBulkReplicateRequestMessage"/>
<xs:element type="tns:BPSUITERplctConfMsg" name="BusinessPartnerSUITEReplicateConfirmationMessage"/>
<xs:element type="tns:BPSUITERplctReqMsg" name="BusinessPartnerSUITEReplicateRequestMessage"/>
<xs:complexType name="BPSUITEBulkRplctReqMsg">
<xs:sequence>
<xs:element type="tns:BusinessDocumentMessageHeader" name="MessageHeader"/>
<xs:element type="tns:BPSUITERplctReqMsg" name="BusinessPartnerSUITEReplicateRequestMessage" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

我收到一个错误:

Error: Illegal namespace for attribute declaration: http://www.w3.org/2001/XMLSchema-instance

请帮忙。

如果您在网络浏览器中打开路径 https://www.w3.org/2001/XMLSchema-instance,您将收到此消息:

XML Schema instance namespace
[...]
This schema should never be used as such: the XML Schema Recommendation forbids the declaration of attributes in this namespace

这应该可以解释您的错误。
要修复它,请查找前缀为 xsi: 的任何属性定义,或者更可能是:

因为你定义了一个 xs:schema 和一个 targetNamespace like

<xs:schema targetNamespace="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:attribute type="xs:string" name="nil"/>
</xs:schema>

要么删除属性,要么更好,更改此命名空间。
这很可能是问题所在。