2012-08-22 1 views
0

Apache Axis로 WebService를 구현하고 있습니다.Axis를 사용하는 생성 된 소스 클래스 java2wsdl/wsdl2java가 원래와 다릅니다

public class ParameterBean { 
    protected String userName = ""; 
    protected String password = ""; 
    protected int clientID = 0; 
    protected int orgID = 0; 
    protected HashMap<String, String> mainTable = new HashMap<String, String>(); 
}  

플러스 전통적인 getter 및 setter :이 서비스는 매개 변수이 멤버가 포함 된 ParameterBean 클래스로받습니다. 이 클래스는 같은 몇 가지 기본적인 방법이있다,

public ParameterBean(String userName, String password, int clientID, int orgID) { 
    this.userName = userName; 
    this.password = password; 
    this.clientID = clientID; 
    this.orgID = orgID; 
} 

Adittionaly : 나는 특별한 생성자를 구현했습니다

public void addColumnToMainTable(String columnName, String columnValue) { 
    addColumnOnTable(mainTable, columnName, columnValue); 
} 

그러나, 나는 java2wsdl 및 WSDL2Java의를 실행할 때; 생성 된 ParameterBean 소스 코드가 많이 다릅니다. 방법 addColumnToMainTable()은 사라지고, 생성 된 생성자는 (원래는 다릅니다)이 하나입니다

public ParameterBean(
    int clientID, 
    java.util.HashMap mainTable, 
    int orgID, 
    java.lang.String password, 
    java.lang.String userName) { 
    this.clientID = clientID; 
    this.mainTable = mainTable; 
    this.orgID = orgID; 
    this.password = password; 
    this.userName = userName; 
} 

내 build.xml 파일 :

<target name="generateWSDL" description="Generates wsdl files from the java service interfaces"> 
<mkdir dir="${wsdl.dir}"/> 
<axis-java2wsdl classpathref="classpath" 
    output="${wsdl.dir}/ExampleWS.wsdl" 
    location="http://localhost:8080/axis/services/ExampleWS" 
    namespace="org.example.ws" 
    classname="org.example.ws.ExampleWS"> 
</axis-java2wsdl> 
</target> 

<target name="generateWSDD" description="Generates wsdd files from the wsdl files"> 
<mkdir dir="${wsdd.dir}"/> 
<axis-wsdl2java 
    output="${wsdd.dir}" 
    deployscope="Application" 
    serverside="true" 
    url="${wsdl.dir}\ExampleWS.wsdl"> 
</axis-wsdl2java> 
</target> 

왜 발생의 차이 암호? 어떻게 해결할 수 있습니까? Axis 1.4를 사용하고 있습니다. 감사.

편집 : 내게 더 중요한 것은 : 어떤 클래스를 사용해야합니까 (서버 쪽과 클라이언트 쪽)? 나의 것 또는 생성 된 것?

답변

0

글쎄, 정확하게 Axis documentation을 읽으면 WSDL에 코드 구현에 대한 정보가 없으므로 기본 생성자와 getters/setter 이외의 다른 메서드가 없기 때문에 생성 된 클래스가 달라집니다.

클라이언트의 경우 생성 된 클래스 또는 원본 클래스를 사용할 수 있습니다. 둘 다 잘 작동합니다.