次の POJO があり、ルート要素が xml ファイルに表示されません (SOAP jax-ws 呼び出しで送信)。問題を指摘してもらえますか?
@XmlRootElement(name = "CATALOGUE")
@XmlAccessorType( XmlAccessType.FIELD )
public class Catalogue implements Serializable, Comparable<Catalogue>
{
@XmlTransient
private Integer catalogueId;
@XmlElement( name = "COMMENT", required = false, nillable = false )
private String catalogueComment;
@XmlElement( name = "VERSION", required = false, nillable = false )
private String catalogueVersion;
@XmlElement( name = "VALID_FROM_DTS", required = false, nillable = false )
private Date catalogueValidFromDts;
@XmlElement( name = "CREATED_DTS", required = false, nillable = false )
private Date catalogueCreatedDts;
@XmlElementWrapper(name = "ITEMLIST")
@XmlElement(name = "ITEM")
private List<Item> itemList;
@XmlTransient
private Integer catalogueLifecyclePhase;
@XmlTransient
private Integer ownerId;
xmlファイルは次のようになります
<COMMENT>LK</COMMENT>
<VERSION>4</VERSION>
<VALID_FROM_DTS>1990-01-25T00:00:00Z</VALID_FROM_DTS>
<CREATED_DTS>2012-05-14T15:49:38.655+01:00</CREATED_DTS>
<ITEMLIST>
<ITEM>
<NAME>Adult Period Pass Corsham</NAME>
<DESC>1 week</DESC>
<SKU>ACT-38</SKU>
<PRICE>15</PRICE>
<CATEGORIES>
<CATEGORY>
<CategoryName>Product</CategoryName>
<CategoryDate>1 week</CategoryDate>
<CategorySortOrder>0</CategorySortOrder>
</CATEGORY>
<CATEGORY>
<CategoryName>Product Type</CategoryName>
<CategoryDate>Coach</CategoryDate>
<CategorySortOrder>0</CategorySortOrder>
</CATEGORY>
.....................
私は次のようなものを期待します
<CATALOGUE> <-----------missing!!!
<COMMENT>LK</COMMENT>
<VERSION>4</VERSION>
<VALID_FROM_DTS>1990-01-25T00:00:00Z</VALID_FROM_DTS>
<CREATED_DTS>2012-05-14T15:49:38.655+01:00</CREATED_DTS>
<ITEMLIST>
<ITEM>
<NAME>Adult Period Pass Corsham</NAME>
<DESC>1 week</DESC>
<SKU>ACT-38</SKU>
<PRICE>15</PRICE>
<CATEGORIES>
<CATEGORY>
<CategoryName>Product</CategoryName>
<CategoryDate>1 week</CategoryDate>
<CategorySortOrder>0</CategorySortOrder>
</CATEGORY>
<CATEGORY>
<CategoryName>Product Type</CategoryName>
<CategoryDate>Coach</CategoryDate>
<CategorySortOrder>0</CategorySortOrder>
</CATEGORY>
.....................
</CATALOGUE>
オブジェクトを返すために使用されるコードは
@Stateless
@Remote
@WebService
public class CatalogueManagerSoapService
{
public CatalogueManagerSoapService()
{
// TODO Auto-generated constructor stub
}
@EJB
private SOAPExportService userService;
@WebMethod
public Catalogue getLatestCatalogue(
String username,
String password,
String catalogueName ) throws Exception
{
Catalogue c = CatManager.getCatalogue();
return c;
}
}