Sidebar

How do I post a MTOM response using qie.postMessageRsponse?

0 votes
338 views
asked Oct 25, 2017 by brandon-w-8204 (33,270 points)
I need to respond with an MTOM response on a channel. How can I build the MTOM response?

1 Answer

0 votes

If your source is an XML source you can use the following function to build the message response:

function checkForMTOM(response,convertMessage) {
   if (source.getNode('/Request/Part/content-type').contains('xop+xml')) {
      // convert to MTOM response
      var boundary = qie.getUUID(true);
      var responseM = qie.parseXMLString(response);
      response = 'Content-Type: multipart/related;' +
      'type="application/xop+xml";' +
      'boundary="' + boundary + '";' +
      'start="<root.message@cxf.apache.org>";' +
      'start-info="application/soap+xml";' +
      'action="' + responseM.getNode('/Envelope/Header/Action') + '"\r\n' +
      '\r\n' +
      '--' + boundary + '\r\n' +
      'Content-Type: application/xop+xml; charset=UTF-8; type="application/soap+xml"\r\n' +
      //'Content-Type: application/soap+xml\r\n' +
      'Content-Transfer-Encoding: binary\r\n' +
      'Content-ID: <root.message@cxf.apache.org>\r\n' +
      '\r\n' +
      //qie.base64Encode(response) + '\n' +
      response + '\r\n' +
      '--' + boundary + '--\r\n';
      if (convertMessage) {
         message = qie.createTextMessage();
      }
   }
   return response;
}
 

answered Oct 25, 2017 by brandon-w-8204 (33,270 points)
...