2013-09-03 5 views
0

Java 1.4에서 Axis 1.1을 사용하고 있습니다. 내 코드가 선반 시스템에 통합되어 있으며 이러한 구성 요소 중 하나를 업그레이드 할 수 없습니다.축 생성 된 wsdl에 모든 유형 정의가 포함되지 않았습니다.

다음 클래스가 있으며 Axis 웹 서비스를 통해 UpdateChartOfAccounts 메서드를 노출하고 있습니다.

<service name="ChartOfAccountsWebService" provider="java:RPC"> 
    <parameter name="allowedMethods" value="UpdateChartOfAccounts"/> 
    <parameter name="className" value="com.integration.webservices.ChartOfAccountsWebService"/> 
    <parameter name="scope" value="Application"/> 
</service> 

이 다음 WSDL을 생성 있습니다 내 서버 config.wsdd에서

public class ChartOfAccountsWebService 
{ 
    public WSResponse[] UpdateChartOfAccounts(WSCostCenter[] costCenters) throws Exception{  
     WSResponse[] responses = new WSResponse[costCenters.length]; 

      //logic removed 

     return responses; 
    } 

    public class WSCostCenter{ 
     public String costCenter; 
     public String costCenterDesc; 
     public String approver; 
     public String companyNumber; 
     public String inactiveFlag; 
    } 

    public class WSResponse{ 
     public String ID; 
     public String col; 
     public String colValue; 
     public String[] errors; 
     public int lineNum; 
     public int recNum; 
    } 
} 

나는 나 서비스를 볼 수 있도록하고 WSDL의 요청 않습니다 다음 블록을 추가했습니다 WSCostCenter 또는 WSResponse 중 하나에 대한 정의가 없습니다 :

<?xml version="1.0" encoding="UTF-8"?> 
<wsdl:definitions targetNamespace="http://localhost:7001/services/ChartOfAccountsWebService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:7001/services/ChartOfAccountsWebService" xmlns:intf="http://localhost:7001/services/ChartOfAccountsWebService" 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> 
     <schema targetNamespace="http://localhost:7001/services/ChartOfAccountsWebService" xmlns="http://www.w3.org/2001/XMLSchema"> 
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> 
      <complexType name="ArrayOf_tns1_ChartOfAccountsWebService_WSCostCenter"> 
       <complexContent> 
        <restriction base="soapenc:Array"> 
         <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:ChartOfAccountsWebService_WSCostCenter[]"/> 
        </restriction> 
       </complexContent> 
      </complexType> 
      <complexType name="ArrayOf_tns1_ChartOfAccountsWebService_WSResponse"> 
       <complexContent> 
        <restriction base="soapenc:Array"> 
         <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:ChartOfAccountsWebService_WSResponse[]"/> 
        </restriction> 
       </complexContent> 
      </complexType> 
     </schema> 
    </wsdl:types> 
    <wsdl:message name="UpdateChartOfAccountsResponse"> 
     <wsdl:part name="UpdateChartOfAccountsReturn" type="impl:ArrayOf_tns1_ChartOfAccountsWebService_WSResponse"/> 
    </wsdl:message> 
    <wsdl:message name="UpdateChartOfAccountsRequest"> 
     <wsdl:part name="costCenters" type="impl:ArrayOf_tns1_ChartOfAccountsWebService_WSCostCenter"/> 
    </wsdl:message> 
    <wsdl:portType name="ChartOfAccountsWebService"> 
     <wsdl:operation name="UpdateChartOfAccounts" parameterOrder="costCenters"> 
      <wsdl:input message="impl:UpdateChartOfAccountsRequest" name="UpdateChartOfAccountsRequest"/> 
      <wsdl:output message="impl:UpdateChartOfAccountsResponse" name="UpdateChartOfAccountsResponse"/> 
     </wsdl:operation> 
    </wsdl:portType> 
    <wsdl:binding name="ChartOfAccountsWebServiceSoapBinding" type="impl:ChartOfAccountsWebService"> 
     <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> 
     <wsdl:operation name="UpdateChartOfAccounts"> 
      <wsdlsoap:operation soapAction=""/> 
      <wsdl:input name="UpdateChartOfAccountsRequest"> 
       <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.integration" use="encoded"/> 
      </wsdl:input> 
      <wsdl:output name="UpdateChartOfAccountsResponse"> 
       <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:7001/services/ChartOfAccountsWebService" use="encoded"/> 
      </wsdl:output> 
     </wsdl:operation> 
    </wsdl:binding> 
    <wsdl:service name="ChartOfAccountsWebServiceService"> 
     <wsdl:port binding="impl:ChartOfAccountsWebServiceSoapBinding" name="ChartOfAccountsWebService"> 
      <wsdlsoap:address location="http://localhost:7001/services/ChartOfAccountsWebService"/> 
     </wsdl:port> 
    </wsdl:service> 
</wsdl:definitions> 

왜 유형 정의가 WSConstCenter 및 WSResponse에 대한 누락? 이 서비스를 그대로 사용하면 올바른 코드가 생성되지 않습니다.

답변

1

Axis는 내 중첩 클래스를 좋아하지 않습니다. 두 개의 내부 클래스를 자신의 Java 파일로 가져 와서 WSDL이 올바르게 생성되었습니다.

public class ChartOfAccountsWebService 
{ 
    public WSResponse[] UpdateChartOfAccounts(WSCostCenter[] costCenters) throws Exception{  
     WSResponse[] responses = new WSResponse[costCenters.length]; 

      //logic removed 

     return responses; 
    } 
} 

public class WSCostCenter{ 
    public String costCenter; 
    public String costCenterDesc; 
    public String approver; 
    public String companyNumber; 
    public String inactiveFlag; 
} 

public class WSResponse{ 
    public String ID; 
    public String col; 
    public String colValue; 
    public String[] errors; 
    public int lineNum; 
    public int recNum; 
}