2017-10-27 4 views
0

私はこの方法があります:私のエンティティがSOAP WSDLサービスによって認識されないのはなぜですか?

@WebResult(name = "accountList") 
public List<Account> getAllAccountWithScoreBiggerThan(@WebParam(name = "scoreValue") int scoreValue) { 
    System.out.println("bigger than " + scoreValue); 
    List<Account> list = dao.findAccountsWithScoreBiggerThan(scoreValue); 
    return list; 
} 

をしかし、私はテストそれのためSOAPUIを使用するとき、私はこのXMLを取得する:私は私のWSDLを見てみると

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
<soap:Body> 
    <ns2:getAllAccountWithScoreBiggerThanResponse xmlns:ns2="http://service/"> 
    <accountList/> 
    <accountList/> 
    <accountList/> 
    </ns2:getAllAccountWithScoreBiggerThanResponse> 
</soap:Body> 
</soap:Envelope> 

は、私がこの作品を得た:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://service/" elementFormDefault="unqualified" targetNamespace="http://service/" version="1.0"> 
<xs:element name="getAllAccountWithScoreBiggerThan" type="tns:getAllAccountWithScoreBiggerThan"/> 
<xs:element name="getAllAccountWithScoreBiggerThanResponse" type="tns:getAllAccountWithScoreBiggerThanResponse"/> 
<xs:complexType name="getAllAccountWithScoreBiggerThan"> 
    <xs:sequence> 
     <xs:element name="scoreValue" type="xs:int"/> 
    </xs:sequence> 
</xs:complexType> 
<xs:complexType name="getAllAccountWithScoreBiggerThanResponse"> 
    <xs:sequence> 
     <xs:element maxOccurs="unbounded" minOccurs="0" name="accountList" type="tns:account"/> 
    </xs:sequence> 
</xs:complexType> 
<xs:complexType name="account"> 
    <xs:sequence/> 
</xs:complexType> 

私のアカウントのすべての属性をリストする予定ではありませんでしたか? ?エンティティの属性を一覧表示するために出力を変更するにはどうすればよいですか?デバッグするとき、私は通常私のすべての属性を見ることができます。

+0

この行でコードにブレークポイントを設定 'List list = dao.findAccountsWithScoreBiggerThan(scoreValue);'データベース結果からSOAPへのマッピングに何か問題が起こっています。 – Namphibian

+0

私はすでにしました。すべてのエンティティの属性はアクセス不可能でした。デバッグレベルで問題が見つかりませんでした – GabrielRado

答えて

0

なぜ私はソースを見つけられなかったのか分かりませんが、属性はSOAPで動作するように名前が付けられたgetterとsetterの両方が必要です。私はそれらを追加した後、それは完全に働いた

関連する問題