CXF Web サービスを使用しています。
シナリオ:
1 つのサービス コールが返されList<NoteDTO>
ます。データはありましたが、List を返す Web サービス メソッドを呼び出した後、クラスNoteDTO
に null 値が表示されます。NoteDTO
ログにも例外はありません。
私の理解では、Web サービスには変換の問題があります。
public class NoteDTO {
/** The text of the note. */
private String text;
/** The date the note was created. */
private Date created;
/** The user who created the note. */
private UserDTO createdBy;
/** The date the note was last modified. */
private Date modified;
/** The last user to modify the note. */
private UserDTO modifiedBy;
private String wfStep;
public void setWfStep(String wfStep) {
this.wfStep = wfStep;
}
/**
* Default constructor for JAXB.
*/
public NoteDTO() {
}
/**
* Constructor taking basic values.
* @param text The text of the note.
* @param created The date created.
* @param createdBy The user who create the note.
*/
public NoteDTO(String text, Date created, UserDTO createdBy) {
this.text = text;
this.created = created;
this.createdBy = createdBy;
}
/**
* Getter for the text of the note.
* @return The text of the note.
*/
public String getText() {
return text;
}
/**
* Setter for the text of the note.
* @param text The text of the note.
*/
public void setText(String text) {
this.text = text;
}
/**
* Getter for the created date.
* @return The created date.
*/
public Date getCreated() {
return created;
}
/**
* Setter for the created date.
* @param created The create date.
*/
public void setCreated(Date created) {
this.created = created;
}
/**
* Getter for the modified date.
* @return The modified date.
*/
public Date getModified() {
return modified;
}
/**
* Setter for the modified date.
* @param modified The modified date.
*/
public void setModified(Date modified) {
this.modified = modified;
}
/**
* Getter for the created by user.
* @return The created by user.
*/
public UserDTO getCreatedBy() {
return createdBy;
}
/**
* Setter for the created by user.
* @param createdBy The created by user.
*/
public void setCreatedBy(UserDTO createdBy) {
this.createdBy = createdBy;
}
/**
* Getter for the modified by user.
* @return The modified by user.
*/
public UserDTO getModifiedBy() {
return modifiedBy;
}
/**
* Setter for the modified by user.
* @param modifiedBy The modified by user.
*/
public void setModifiedBy(UserDTO modifiedBy) {
this.modifiedBy = modifiedBy;
}
/**
* Getter for the workflow step.
* @return The workflow step.
*/
public String getWfstep() {
return this.wfStep;
}
私はWebサービスクラスを持っています
@WebService
public interface NotesService {
/**
* Get server notes for a specific workflow instance
* @param workflowInstanceEntitityId Workflow Instance Entity ID
* @return A list of notes.
*/
List<NoteDTO> getNotesForWorkflowInstance(String bundleName, String workflowInstanceName);
}
データはNoteDTOの反対側にありましたが、以下のような呼び出しの後
notes = notesService.getNotesForWorkflowInstance(bundleName, workflowInstanceName);
wfStep プロパティ値を null として取得しています
何かご意見は?
前もって感謝します。