不正确的值:未知命名空间 http://www.w3.org/2001/xmlschema

incorrect value: unknown namespace http://www.w3.org/2001/xmlschema

当我厌倦了在 sap 中创建客户端代理并提供服务提供商 web 服务时,我正在尝试在 sap 中使用外部 Web 服务(WSDL 文件)进行数据集成 URL http://172.31.3.48:8717/?wsdl it gives me proxy generation error it giving me a error of "liberary haldler exception" " incorrect value: unknown namespace http://www.w3.org/2001/xmlschema" . I am facing this error in just in this file which provided by my services provider , except this all of the wsdl file generated successfully one the file which generated suceesfully is this http://www.webservicex.net/stockquote.asmx?WSDL.

我们将不胜感激。

Given below is my Wsdl file which giving me error..

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/">
  <wsdl:types>
  <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
  <s:element name="GetData">
  <s:complexType>
  <s:sequence>
  <s:element minOccurs="0" maxOccurs="1" name="user" type="s:string"/>
  <s:element minOccurs="0" maxOccurs="1" name="pass" type="s:string"/>
  <s:element minOccurs="0" maxOccurs="1" name="fromdate" type="s:string"/>
  <s:element minOccurs="0" maxOccurs="1" name="todate" type="s:string"/>
  </s:sequence>
  </s:complexType>
  </s:element>
  <s:element name="GetDataResponse">
  <s:complexType>
  <s:sequence>
  <s:element minOccurs="0" maxOccurs="1" name="GetDataResult">
  <s:complexType>
  <s:sequence>
  <s:element ref="s:schema"/>
  <s:any/>
  </s:sequence>
  </s:complexType>
  </s:element>
  </s:sequence>
  </s:complexType>
  </s:element>
  </s:schema>
  </wsdl:types>
  <wsdl:message name="GetDataSoapIn">
  <wsdl:part name="parameters" element="tns:GetData"/>
  </wsdl:message>
  <wsdl:message name="GetDataSoapOut">
  <wsdl:part name="parameters" element="tns:GetDataResponse"/>
  </wsdl:message>
  <wsdl:portType name="WSCRPL9001Soap">
  <wsdl:operation name="GetData">
  <wsdl:input message="tns:GetDataSoapIn"/>
  <wsdl:output message="tns:GetDataSoapOut"/>
  </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="WSCRPL9001Soap" type="tns:WSCRPL9001Soap">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
  <wsdl:operation name="GetData">
  <soap:operation soapAction="http://tempuri.org/GetData" style="document"/>
  <wsdl:input>
  <soap:body use="literal"/>
  </wsdl:input>
  <wsdl:output>
  <soap:body use="literal"/>
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="WSCRPL9001Soap12" type="tns:WSCRPL9001Soap">
  <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
  <wsdl:operation name="GetData">
  <soap12:operation soapAction="http://tempuri.org/GetData" style="document"/>
  <wsdl:input>
  <soap12:body use="literal"/>
  </wsdl:input>
  <wsdl:output>
  <soap12:body use="literal"/>
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="WSCRPL9001">
  <wsdl:port name="WSCRPL9001Soap" binding="tns:WSCRPL9001Soap">
  <soap:address location="http://172.31.3.48:8717/WS-CRPL-9001.asmx"/>
  </wsdl:port>
  <wsdl:port name="WSCRPL9001Soap12" binding="tns:WSCRPL9001Soap12">
  <soap12:address location="http://172.31.3.48:8717/WS-CRPL-9001.asmx"/>
  </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

这个元素似乎有些不对劲。直接引用架构的元素对我来说很奇怪 - 我从未见过这样的结构:

    <s:element name="GetDataResponse">
        <s:complexType>
            <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="GetDataResult">
                    <s:complexType>
                        <s:sequence>
                            <s:element ref="s:schema" />
                            <s:any />
                        </s:sequence>
                    </s:complexType>
                </s:element>
            </s:sequence>
        </s:complexType>
    </s:element>

我已经在 Eclipse 中验证了您的 WSDL - 查看 Eclipse 对此 WSDL 的说明:

解析组件时出错 's:schema'。检测到 's:schema' 在命名空间“http://www.w3.org/2001/XMLSchema”中,但无法从架构文档 'file:///WSDLTEST.wsdl' 中引用来自此命名空间的组件。如果这是不正确的命名空间,可能需要更改 's:schema' 的前缀。如果这是正确的命名空间,则应将适当的 'import' 标记添加到 'file:///WSDL.wsdl'.

尝试完全删除 <s:element ref="s:schema" /> 行,看看它是否适合您。或者按照请求 GetData 的方式逐个元素地描述序列。