简体   繁体   English

WSO2 ESB 返回一串 json 结构

[英]WSO2 ESB return a string of json structures

I'm building an API Resource and return a string of json structures我正在构建一个 API 资源并返回一串 json 结构

enter image description here在此处输入图片说明

An error : wso2 com.ctc.wstx.exc.wstxunexpectedcharexception: unexpected character '{' (code 123) in prolog;一个错误: wso2 com.ctc.wstx.exc.wstxunexpectedcharexception: prolog 中的意外字符 '{' (code 123); expected '<' at [row,col {unknown-source}]: [1,1] [row,col {unknown-source}] 处的预期“<”:[1,1]

enter image description here在此处输入图片说明

next time please try to use formatted text here, not screenshots.下次请尝试在此处使用格式化文本,而不是屏幕截图。 You suppose to make the question easy to read for us您想使问题易于我们阅读

unexpected character '{' (code 123) in prolog;序言中的意外字符“{”(代码 123); expected '<' at [row,col {unknown-source}]: [row,col {unknown-source}] 处的预期“<”:

See the service annotation, it says @Produces Application.XML.查看服务注释,它说@Produces Application.XML。 So the service returns the Content-Type header as "application/xml", but the content is JSON.因此该服务将Content-Type标头作为“application/xml”返回,但内容是 JSON。

The exception is saying that the ESB is trying to parse your returned XML (the service claims the content is XML) but it is not correct format例外情况是 ESB 正在尝试解析您返回的 XML(服务声称内容是 XML)但它的格式不正确

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM