Eclipse中的WSDL验证无法进行名称空间

伊夫万那利德

我已经制作了WSDL文件,并打算从中创建自上而下的Web服务。不幸的是,Eclipse抛出此错误:

"A problem occurred while running the WSDL validator for namespace http://schemas.xmlsoap.org/wsdl/"

我进行了一些研究,似乎是由于某些Eclipse wsdl-validation错误而发生的,在这里进行了解释

那里的某个人声称他已使用补丁程序修复了此错误,我已经应用了此错误,但是错误仍然存​​在,我开始认为我的wsdl文件本身存在问题。

WebService应该获取ID的列表(列),并根据这些ID返回2列的表数据。

您能帮我找出问题所在吗?

用于Web开发人员的Eclipse Java EE IDE。版本:Mars.2发行版(4.5.2)内部版本号:20160218-0600 WTP 1.2.1.20150819-2220

这是WSDL文件:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions 
  targetNamespace="reb.ecm.ws.RebUtilsService"
        xmlns="reb.ecm.ws.RebUtilsService"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
        xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">


    <wsdl:types>
      <xsd:complexType name='DPList'>
        <xsd:element
          minOccurs='0'
          maxOccurs='unbounded'
          name='DP'
          type='DP'/>
      </xsd:complexType>
      <xsd:complexType name='DP'>
        <xsd:all>
          <xsd:element
            minOccurs='0'
            maxOccurs='1'
            name='DPID'
            type='xsd:int'/>
        </xsd:all>
      </xsd:complexType>
      <xsd:complexType name='WSInfoList'>
        <xsd:element
          minOccurs='0'
          maxOccurs='unbounded'
          name='WSInfoItem'
          type='WSInfoItem'/>
      </xsd:complexType>
      <xsd:complexType name='WSInfoItem'>
        <xsd:all>
          <xsd:element
            minOccurs='0'
            maxOccurs='1'
            name='DPID'
            type='xsd:int'/>
        </xsd:all>
        <xsd:all>
          <xsd:element
            minOccurs='0'
            maxOccurs='1'
            name='WSID'
            type='xsd:int'/>
        </xsd:all>
      </xsd:complexType>
    </wsdl:types>

    <wsdl:message name="inMessage">
        <wsdl:part name="DPList" type="DPList" />
    </wsdl:message>

    <wsdl:message name="outMessage">
        <wsdl:part name="WSInfoList" type="WSInfoList" />
    </wsdl:message>
    <wsdl:portType name="RebUtilsServicePortType">
        <wsdl:operation name="GetActualWSIDbyDPID"  >
            <wsdl:input message="inMessage" />
            <wsdl:output message="outMessage" />
        </wsdl:operation>
                    </wsdl:portType>

    <wsdl:binding name="RebUtilsServiceHTTPBinding" 
            type="RebUtilsServicePortType">
        <wsdlsoap:binding style="document" 
            transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="GetActualWSIDbyDPID">
            <wsdlsoap:operation soapAction=""/>
             <wsdl:input>
                <wsdlsoap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <wsdlsoap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>

    <wsdl:service name="RebUtilsServicePorts">
        <wsdl:port binding="RebUtilsServiceHTTPBinding"  name="RebUtilsService">
            <wsdlsoap:address 
                location="http://localhost:9084/RebUtilsService/RebUtilsServicePorts"/>
        </wsdl:port>
    </wsdl:service>

</wsdl:definitions>

更新:Eclipse没有问题。至少补丁,前面提到的修复了一些问题。

Praveen Kumar KS

回答

  1. 您的架构未正确定义。请参见下图。datatypeError
  2. 请将其更改为在模式定义中定义的更正后的数据类型元素,请在Eclipse WSDL Design视图中进行更改。 correctedSchema
  3. 重新生成您的客户并告知结果。
  4. 您应该具有单独的XSD模式文件,并应根据您的要求进行映射,这就是失败的原因,请查看分解的设计视图。模式映射

一般规则

  1. 创建SOAP服务时,请定义所需的输入/输出XSD模式

  2. 使用模式作为输入,您需要使用IDE / Maven /任何构建工具生成WSDL文件。

  3. 为便于操作/编辑,请选择Eclipse WSDL编辑器。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章