1

wsdl ファイルから Java クラスを生成しようとしています。元々、このファイルは Axis 1.1 で問題なく使用されていました。その後、Axis1 が Axis2 に置き換えられ、次のエラーで生成が機能しなくなりました。

 [java] Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerat

ionException: org.apache.axis2.wsdl.codegen.CodeGenerationEngine.(CodeGenerationEngine.java:175) で WSDL [java] を解析中にエラーが発生しました [java] at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35) ) [java] at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24) [java] 原因: org.apache.axis2.AxisFault: There are no parts for fault message: {http:// www.w3.org/2001/XMLSchema}createPolicyCustomLSPDTOFault [java] at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) [java] at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.popul ateService(WSDL11ToAxisServiceBuilder. java:411) [java] at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.p opulateAllServices(WSDL11ToAllAxisServicesBuilder.java:107) [java] at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.(CodeGenerationEngine.java:169) [java] ... 2 つ以上

wsdl ファイルのエラー行:

<wsdl:operation name="createPolicyCustomLSPDTO">
  <wsdl:input message="tns:createPolicyCustomLSPDTORequest"/>
  <wsdl:output message="tns:createPolicyCustomLSPDTOResponse"/>
  <wsdl:fault name="Fault" message="tns:createPolicyCustomLSPDTOFault"/>
</wsdl:operation>

createPolicyCustomLSPDTOFault は次のように定義されます

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:tns="http://webservice.example.com"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:hql="http://hql.webservice.example.com"
    targetNamespace="http://webservice.example.com"
>

    <wsdl:types>
        <xsd:import namespace="http://webservice.example.com" schemaLocation="ServerMessageDTO.xsd"/>
        <xsd:schema
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://webservice.example.com"
        >
            <xsd:element name="createPolicyCustomLSPDTOFault" type="tns:ServerMessageDTO"/>
        </xsd:schema>
    </wsdl:types>

これを修正するにはどうすればよいですか?

4

0 に答える 0