當在使用cxf-rs的webservice的時候,有時候在傳輸數據,會發生這種錯誤
錯誤代碼:
Response-Code: 500 Content-Type: text/plain Headers: {Content-Type=[application/xml], Date=[Thu, 10 Aug 2017 06:41:49 GMT]} Payload: No message body writer has been found for class cn.itcast.bos.domain.base.Area, ContentType: application/xml
這是由於實體類上,沒有配置@XmlRootElement注解,這樣一來,webservice就沒辦法去把元素給解析成xml格式或者json格式了