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

时间:2015-04-10 10:49:43

标签: web-services soap wsdl sap soa

我正在尝试在sap中使用外部Web服务(WSDL FILE)进行数据集成,因为我厌倦了在sap中创建客户端代理并为服务提供商提供Web服务URL http://172.31.3.48:8717/?wsdl 它给了我代理生成错误它给了我一个错误" liberary haldler exception" "错误的值:未知的名称空间http://www.w3.org/2001/xmlschema" 。我在我的服务提供商提供的这个文件中遇到了这个错误,除了这个成功生成的所有wsdl文件之外,生成的文件是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>

1 个答案:

答案 0 :(得分:3)

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

    <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的说法:

解析组件的错误:架构&#39;。它被发现了:架构&#39;在名称空间&#39; http://www.w3.org/2001/XMLSchema&#39;中,但此命名空间中的组件无法从架构文档&file:///WSDLTEST.wsdl'中引用。如果这是不正确的命名空间,可能是&#39; s的前缀:schema&#39;需要改变。如果这是正确的命名空间,那么适当的导入&#39;标签应添加到&#39; file:///WSDL.wsdl'。

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

相关问题