私はAxis2/Webservice初心者です。単純なPOJOをWebサービス(以下のコード)に変換しようとしています。クラスPieceInfo
には@XmlRootElement
と注釈が付けられています。クラス(ObjectFactory
)は、メソッド(以下のコード)でPieceInfoを返します。 PieceInfo
の作業を使用するメソッドは、java.util.List is not known to this context
などのJAXB例外をスローするパラメータとしてList<PieceInfo>
またはPieceInfo[]
を使用するメソッドです。リストや配列はうまくいくはずだと思った。私は間違って何をしていますか?Axis2のパラメータとしての配列POJO Webservices?
@WebService (name="KMPService",targetNamespace="http://www.ict.ie.tss/")
@MTOM
public interface KMPServiceInterface {
@WebMethod
void updateRootInfo(String username, String password, PieceInfo info);
@WebMethod
PieceInfo getRootInfo(String username, String password);
@WebMethod
void put(String username, String password, List<PieceInfo> infoList);
@WebMethod
PieceInfo[] get(String username, String password,
PieceInfo[] infoList);
@WebMethod
void deleteEntries(String username, String password,
PieceInfo[] infoList);
}
ObjectFacotry:代わりのjava.util.Listの
@XmlRegistry
public class ObjectFactory {
public PieceInfo createPieceInfo(){
return new PieceInfo();
}
}
アレイも機能しません。私が配列を使うと、私は '[... model.PieceInfo;この文脈では知られていない。私がただ一つの 'PieceInfo'オブジェクトを使っていれば、うまく動作します。ちょうど彼らの配列やそれらのリストではありません。 – Carsten