【发布时间】:2015-04-22 06:32:05
【问题描述】:
我开发了一个spring webservice,它会返回一个空响应,但问题是内容类型是text/palin。我想将内容类型设置为 text/xml,已搜索选项但无法获得确切的方法。
这是我的代码:
@Endpoint
public class Service{
@PayloadRoot(namespace = "http://sample.com/webservice", localPart = "sendReport")
@ResponsePayload
public void recieveReport(@RequestPayload SendReport report){
// processing the report response
}
}
谁能尽快解释一下,因为这阻碍了我目前的工作。
【问题讨论】:
-
可以使用
@Consumes(MediaType.APPLICATION_XML)注解。
标签: java web-services soap spring-ws