IBM Worklight HTTP Adapter SOAP response: XSL transformation failed

痴心易碎 提交于 2019-12-01 12:40:45

The adapter is doing exactly what you tell it to do. In the XSL transform, you are dropping the response from the server (returning nothing), and then you are expecting the result Envelope.Body to be present after the transform

return result.Envelope.Body;

Envelope is undefined in the output from your XSL, so the error message:

"Ecma Error: TypeError: Cannot read property \"Body\" from undefined

makes perfect sense. You need to put something on the transform to create an Envelope and a Body:

<xsl:template match="/">
    {"Envelope": {"Body": {"content": "This is the content"}}}
</xsl:template>

Or you could just leave Envelope/Body out of your XSL and just return the JSON of content.

But if you unwrap the body in the XSL, you can't do it again in the return statement of your function.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!