webservice接口问题:Payload: No message body writer has been found for class domain, ContentType: application/xml


当在使用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格式了


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM