0
コンテンツ・タイプがmultipart/related
のSOAPサービスをHTTPアダプターから呼び出す必要があります。IBM Mobile First 7.1:マルチパート/関連コンテンツ・タイプおよびXSL変換
私は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: <[email protected]>\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=\"<[email protected]>\"; start-info=\"text/xml\""
...
}
}
xsl変換は実行されません。 テキストパラメータの一部の文字列操作では、SOAP応答を文字列として取得できますが、手動でXSL変換を呼び出してjsonを取得する方法(一部のAPI)が見つかりませんでした。