Java CXF/JAX-B:未生成setter
我从xsd生成了以下类。当我尝试发布到该服务时,出现以下错误。原因是并没有生成setter,原因在代码部分的注释中提供。你的工作是什么?显然,我不想把它设为可忽略的 org.codehaus.jackson.map.exc.UnrecognizedPropertyException: 无法识别的字段“令牌”(类 com.rat.service.api.schema.ArrayOfToken),未标记为可忽略 * * * *列表中允许以下类型的对象 *{@link-Token} * * */ 公共列表getToken(){ if(标记==null){ token=newarraylist(); } 返回此.token; }Java CXF/JAX-B:未生成setter,java,web-services,cxf,Java,Web Services,Cxf,我从xsd生成了以下类。当我尝试发布到该服务时,出现以下错误。原因是并没有生成setter,原因在代码部分的注释中提供。你的工作是什么?显然,我不想把它设为可忽略的 org.codehaus.jackson.map.exc.UnrecognizedPropertyException: 无法识别的字段“令牌”(类 com.rat.service.api.schema.ArrayOfToken),未标记为可忽略 * * * *列表中允许以下类型的对象 *{@link-Token} * * *
这可能是因为您正在发布的对象:它可能与生成的类不匹配,您能否举例说明您正在向服务发布什么?您发送的输入是什么?
@XmlRootElement(name = "ArrayOfToken")
public class ArrayOfToken
implements Serializable
{
private final static long serialVersionUID = 1L;
@XmlElement(name = "Token", required = true)
protected List<Token> token;
/**
* Gets the value of the token property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the token property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getToken().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Token }
*
*
*/
public List<Token> getToken() {
if (token == null) {
token = new ArrayList<Token>();
}
return this.token;
}