Je dois appeler à partir d'un adaptateur HTTP un service SOAP ayant un type de contenu multipart/related
.IBM Mobile First 7.1: transformation de type de contenu et XSL multipart/apparentée
Si j'utilise cet objet comme paramètre 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'
}
};
J'ai eu cette erreur:
"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]"
Je modifié le paramètre returnedContentType: 'plain'
pour obtenir un résultat. Maintenant la réponse ressemble à ceci:
{
"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\""
...
}
}
Mais la transformation xsl n'est pas effectuée. Avec une manipulation de chaîne sur le paramètre text je peux obtenir la réponse SOAP sous forme de chaîne mais je n'ai pas trouvé de moyen (une API) d'invoquer manuellement la transformation XSL pour obtenir un json.