【发布时间】:2016-10-03 08:39:55
【问题描述】:
我需要从 HTTP 适配器调用具有 multipart/related 内容类型的 SOAP 服务。
如果我将此对象用作WL.Server.invokeHttp 参数
{
method : 'post',
returnedContentType : 'xml',
returnedContentEncoding : 'utf-8',
path : servicePath,
body : {
content : MY_REQUEST,
contentType : "text/xml; charset=utf-8"
},
transformation: {
type: 'xslFile',
xslFile: 'myXsl.xsl'
}
};
我收到了这个错误:
"Runtime: Failed to read the HTTP response to: /MyService
\njava.lang.IllegalArgumentException: Http content type 'multipart/related' not supported.
Supported types are: [json, css, csv, javascript, plain, xml, html]"
于是我修改了参数returnedContentType: 'plain',得到了一个结果。现在响应如下所示:
{
"isSuccessful": true,
"errors": [],
"warnings": [],
"info": [],
"text": "--uuid:85c87f37-9436-41d1-94d4-0b944c3618b1\nContent-Type: application/xop+xml; charset=UTF-8; type=\"text/xml\";\nContent-Transfer-Encoding: binary\nContent-ID: <root.message@cxf.apache.org>\n\n
MY SOAP RESPONSE
\n--uuid:85c87f37-9436-41d1-94d4-0b944c3618b1--",
"responseHeaders": {
...
"Content-Type": "multipart/related; type=\"application/xop+xml\"; boundary=\"uuid:85c87f37-9436-41d1-94d4-0b944c3618b1\"; start=\"<root.message@cxf.apache.org>\"; start-info=\"text/xml\""
...
}
}
但是没有执行 xsl 转换。 通过对文本参数进行一些字符串操作,我可以将 SOAP 响应作为字符串获取,但我没有找到一种方法(某些 API)来手动调用 XSL 转换以获取 json。
【问题讨论】:
标签: ibm-mobilefirst multipart worklight-adapters mobilefirst-adapters