【问题标题】:Getting Property is already defined error from wsimport从 wsimport 获取属性已定义错误
【发布时间】:2017-07-14 12:16:16
【问题描述】:

我从 stackoverflow 中查看了类似的解决方案,但我无法处理。 它说:[错误] 属性“任何”已经定义。使用 解决此冲突。我创建了一个绑定 xml 来解决冲突并尝试重命名“任何”属性,它说您的 XPath 不正确。但我找不到路径中的错误在哪里。为了更好地解释,共享我无法对其进行任何更改的“wsdl”,它的外部服务。还有我的绑定xml。

WSDL:

<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri_integration.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri_integration.org/">
    <wsdl:types>
        <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri_integration.org/">
            .
            .
            .
            <s:element name="Get_DataSet_Data_With_IDResponse">
                <s:complexType>
                    <s:sequence>
                        <s:element minOccurs="0" maxOccurs="1" name="Get_DataSet_Data_With_IDResult">
                            <s:complexType>
                                <s:sequence>
                                    <s:any minOccurs="0" maxOccurs="unbounded" namespace="http://www.w3.org/2001/XMLSchema" processContents="lax"/>
                                    <s:any minOccurs="1" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" processContents="lax"/>
                                </s:sequence>
                            </s:complexType>
                        </s:element>
                        <s:element minOccurs="0" maxOccurs="1" name="pref_err" type="s:string"/>
                    </s:sequence>
                </s:complexType>
            </s:element>
        </s:schema>
    </wsdl:types>
</wsdl:definitions>

绑定xml:

<jxb:bindings xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
              xmlns="http://java.sun.com/xml/ns/jaxws"
              xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
              xmlns:s="http://www.w3.org/2001/XMLSchema"
              wsdlLocation="http://10.10.10.10:8080/integration.asmx?wsdl">

    <jxb:bindings
            node="/wsdl:definitions/wsdl:types/s:schema/s:element[@name='Get_DataSet_Data_With_IDResponse']/s:complexType/s:sequence/s:element[@name='Get_DataSet_Data_With_IDResult']/s:complexType/s:sequence/s:any[@namespace='urn:schemas-microsoft-com:xml-diffgram-v1']/s:complexType">
        <jxb:property name="any2"/>
    </jxb:bindings>
</jxb:bindings>

还有这样的cmd命令:

wsimport -clientjar export.jar -b binding.xml http://10.10.10.10:8080/integration.asmx?wsdl

【问题讨论】:

    标签: java xml jaxb wsdl wsimport


    【解决方案1】:

    终于明白了,解决了我的问题。

    我忘记了 schemaLocation。这也是我的财产的错误路径。

    有我的绑定xml:

    <jxb:bindings version="2.0" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  xmlns="http://java.sun.com/xml/ns/jaxws"
                  xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
                  xmlns:s="http://www.w3.org/2001/XMLSchema"
    >
        <jxb:bindings schemaLocation="http://10.10.10.10:8080/integration.asmx?wsdl#types?schema1"
                      node="//s:element[@name='Get_DataSet_Data_With_IDResponse']/s:complexType/s:sequence/s:element[@name='Get_DataSet_Data_With_IDResult']/s:complexType/s:sequence/s:any[@namespace='urn:schemas-microsoft-com:xml-diffgram-v1']">
            <jxb:property name="any2"/>
        </jxb:bindings>
    </jxb:bindings>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-20
      • 2016-09-14
      • 2023-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多