2017-10-13 3 views
0

wsdlからJavaファイルを生成するためにmaven-jaxb2-pluginを使用しています。実行した後、いくつかのWSDLファイルがあります単一のファイル内のターゲット名前空間の複数の<schemaBindings>

[ERROR] Error while parsing schema(s).Location[ 
file:/home/*/src/main/resources/soap/binding.xjb{8,30} ]. 
com.sun.istack.SAXParseException2; systemId: file:/home/*/src/main/resources/soap/binding.xjb; lineNumber: 8; columnNumber: 30; 
Multiple <schemaBindings> are defined for the target namespace "http://schemas.***" 

私は次のようなエラーに取得目標を「-ソースを生成」およびそれらのそれぞれのために私は別のターゲットパッケージを必要とするので、私はバインディングファイルを使用してみましたが、今のところ唯一の1 WSDLの。ここで

は私のプラグインconfiguraitonある

<configuration> 
    <schemaLanguage>WSDL</schemaLanguage> 
    <schemaDirectory> 
     ${basedir}/src/main/resources/soap 
    </schemaDirectory> 
    <schemaIncludes> 
     <include>manager/*.wsdl</include> 
    </schemaIncludes> 
    <bindingDirectory> 
     ${basedir}/src/main/resources/soap 
    </bindingDirectory> 
</configuration> 
ここ

binding.xjbファイル

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<jaxb:bindings 
     version="2.1" 
     xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" 
     xmlns:xs="http://www.w3.org/2001/XMLSchema"> 

    <jaxb:bindings schemaLocation="manager/service.wsdl" multiple="true" node="//xs:schema"> 
     <jaxb:schemaBindings> 
      <jaxb:package name="com.test.manager"/> 
     </jaxb:schemaBindings> 
    </jaxb:bindings> 
</jaxb:bindings> 

始まりservice.wsdlのファイル

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
        xmlns:sch0="http://schemas.***" 
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
        xmlns:tns="http://schemas.***" 
        targetNamespace="http://schemas.***"> 
    <wsdl:types> 
     <xs:schema xmlns="http://schemas.***" 
        xmlns:xs="http://www.w3.org/2001/XMLSchema" 
        attributeFormDefault="unqualified" 
        elementFormDefault="qualified" 
        targetNamespace="http://schemas.***"> 
      <xs:simpleType name="NumericReference"> 
       *** 
      </xs:simpleType> 
      <xs:simpleType name="EntityNumber"> 
       *** 
      </xs:simpleType> 
     </xs:schema> 
     <xs:schema xmlns="http://schemas.***" 
        xmlns:xs="http://www.w3.org/2001/XMLSchema" 
        attributeFormDefault="unqualified" 
        elementFormDefault="qualified" 
        targetNamespace="http://schemas.***"> 
      <xs:complexType name="DisplayGroup"> 

は、問題のように見えるさ同じtargetNamespaceを持つ複数のxs:schema要素に接続されていますが、wsdlを変更せずに修正する方法が見つかりません。

答えて

1

通常、JAXBは1つのターゲット名前空間を1つのパッケージにマッピングするため、同じターゲット名前空間に異なるschemaBindingsを指定することはできません。

関連する問題