私はクラスを持っています
public class Calculator {
public Test getTest(){
return new Test();
}
}
Web サービスとして公開したいもの。テスト定義は次のとおりです。
public class Test {
private Test2[] tests;
@XmlTransient
public Test2[] getTests() {
return tests;
}
public void setTests(Test2[] tests) {
this.tests = tests;
}
}
ここで、Test2[] テストで @XmlTransient アノテーションを追加すると、生成された WSDL にリストされないことが予想されます (私は Eclipse を使用しているので、電卓 > Web サービス > Web サービスの生成を右クリックします)。 m 正しくありません:
...
<wsdl:types>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="...">
<xs:complexType name="Test">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="tests" nillable="true" type="ax21:Test2"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Test2">
<xs:sequence/>
</xs:complexType>
</xs:schema>
...
</wsdl:types>
...
ご覧のとおり、テストはまだ WSDL に存在しています (5 行目)。役立つ場合は、Axis2、Eclipse Indigo を使用しています。