【发布时间】:2018-06-02 00:21:34
【问题描述】:
处理用例,Springboot 微服务接受 JSON 有效负载,然后,在 @RestController 的处理程序中,API 将触发另一个下游应用程序应用程序,该应用程序接受 application/xml 或 text/xml 中的有效负载??
/api/v1/users Type:application/JSON ---> /api/v1/downstream/ Type: text/xml
使用 RestTemplate 和 HTTPEntity 来表示 Request 和 Response 实体。
现在面临以下错误:
Could not extract response: no suitable HttpMessageConverter found for response type (How could I register new message converters), please bare with me I'm new to Spring boot and Spring.
如果我使用@XmlRootElement 注释,那么错误是:无法为类实例化 JAXBContext。
还有什么建议我怎样才能实现这个功能?
【问题讨论】:
-
请发布您的代码
-
对不起@AlexSavitsky,我不能分享这个工作场所代码,但会在使用虚拟逻辑复制业务逻辑后发布。
标签: java spring rest spring-boot microservices