2014-07-23 2 views
2

타사 웹 서비스를 통합 할 때 문제가 있습니다. [오류] 목표 org.apache.cxf를 실행하지 못했습니다 : cxf-codegen-plugin : 2.4.2 : 프로젝트에서 wsdl2java (generate-sources) pcm_portal : JAXB에 의해 던졌습니다 : 'string15'는 이미 있습니다. 스키마의 305 행 2에 정의 된 ... -> [도움말 1]동일한 대상 네임 스페이스에 중복 형식 정의가있는 wsdl

실제로이 파일에는 동일한 대상 네임 스페이스에 대한 전체 스키마가 들어 있으며 두 가지 모두에 정의 된 동일한 simpleType (string15)을 찾을 수 있습니다. 스키마.

그것은이 같은 뭔가 :

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:tns="http://siebel.com/CustomUI" ...> 
    <types> 
     <!-- ... --> 
     <xsd:schema elementFormDefault="qualified" 
      attributeFormDefault="unqualified" 
      targetNamespace="http://myNs/" 
      xmlns:xsdLocal3="http://myNs/"> 
      <!-- ... --> 
      <xsd:simpleType name="string15"> 
       <xsd:restriction base="xsd:string"> 
        <xsd:maxLength value="15"></xsd:maxLength> 
       </xsd:restriction> 
      </xsd:simpleType> 
      <!-- ... --> 
     </xsd:schema> 
     <!-- ... --> 

     <xsd:schema elementFormDefault="qualified" 
      attributeFormDefault="unqualified" 
      targetNamespace="http://myNs/" 
      xmlns:xsdLocal3="http://myNs/"> 
      <!-- ... --> 
      <xsd:simpleType name="string15"> 
       <xsd:restriction base="xsd:string"> 
        <xsd:maxLength value="15"></xsd:maxLength> 
       </xsd:restriction> 
      </xsd:simpleType> 
      <!-- ... --> 
     </xsd:schema> 
     <!-- ... --> 
    </types> 
</definitions> 

내 질문

1) WSDL2Java가 같은 파일을 처리 할 수 ​​있도록하는 방법이 있나요?

오늘은 받는다는 CXF-CODEGEN - 플러그인을 통해 그것을 사용하고 있는데이 구성되어 있지 누군가가 있기 때문에 나에게 인수 될 수있는 참조 문서를 알고있는 경우

<defaultOptions> 
    <extraargs> 
     <extraarg>-exsh</extraarg> 
     <extraarg>true</extraarg> 
     <extraarg>-xjc-npa</extraarg> 
    </extraargs> 
</defaultOptions> 

2) 팀이 저에게 wsdl에게 문제가 없다고 말했습니다 (실제로 SoapUI는이 WSDL에 문제가 없습니다).

+0

http://stackoverflow.com/questions/6681265/is-there-a-way-to-deal-with-duplicate-element-definitions-across-multiple-xsd-f http://cxf.apache.org/cxf-xjc-plugin.html –

+0

답변 해 주셔서 감사합니다. 실제로 제 문제와 매우 비슷합니다. 글쎄, 내 복제본이 동일한 wsdl 파일 (수정되지 않았거나 분리되지 않았 으면 좋음)에 있기 때문에 해결 방법이 적용되는지 잘 모르겠습니다. – scherzoteller

+0

어떻게 해결 했습니까? 같은 문제에 직면 해있다. – ronnyfm

답변

0

저는 과거에도 같은 문제가있었습니다.

나는 "CXF-CODEGEN - 플러그인"

예에서 스키마의 생성을 제외

<extraarg>-nexclude</extraarg> 
<extraarg>http://myNs/</extraarg> 

나는 다른 파일 (XSD)에서 스키마를 추출하고, 내가 그들을 생성하기 위해 "받는다는 - 플러그인 - JAXB2"를 사용했다.

분명히 동일한 네임 스페이스를 가진 두 개의 동일한 개체를 선언 할 수 없기 때문에 동일한 네임 스페이스로 스키마를 병합해야합니다.

이 솔루션으로 문제를 해결할 수 있기를 바랍니다.

관련 문제