AnsweredAssumed Answered

Disabling MTOM for CMIS SOAP

Question asked by brus on Mar 28, 2016
In our ERP system, I have to support integration library using SAAJ, integrating with various Content Management systems using CMIS SOAP interface. That is really big chunk of legacy code that has been used in production for years.
We have several clients using Alfresco, and now suddenly (I think with version 5?) they cannot use integration because Alfresco CMIS SOAP api requires MTOM.
I still have not figured out how to make SAAJ use MTOM, if that is possible at all.
Is there any way to disable MTOM on Alfresco server and use old-fashioned SOAP with attachments?
Please don't tell me to use JAX-WS or REST, I am in no position to rewrite the whole integration library.

Thanks,
Boris



Well, here is the problem: <strong>Alfresco CMIS should be able to accept multipart SOAP requests and plain SOAP requests without attachments.</strong>

This simple request is invalid in Alfresco 5.0:

POST http://cmis.alfresco.com/alfresco/cmisws/RepositoryService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
Content-Length: 1305
Host: cmis.alfresco.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

<soapenv:Envelope xmlns:ns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header>..removed..</soapenv:Header>
   <soapenv:Body>
      <ns:getRepositories/>
   </soapenv:Body>
</soapenv:Envelope>


giving response: <message>The request is not MTOM encoded.</message>

At the same time the following request is fine:

POST http://cmis.alfresco.com/alfresco/cmisws/RepositoryService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/related; type="application/xop+xml"; start="<rootpart@soapui.org>"; start-info="text/xml"; boundary="—-=_Part_2_27870721.1460556134511"
SOAPAction: ""
MIME-Version: 1.0
Content-Length: 1526
Host: cmis.alfresco.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)


——=_Part_2_27870721.1460556134511
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: <rootpart@soapui.org>

<soapenv:Envelope xmlns:ns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header>..removed..</soapenv:Header>
   <soapenv:Body>
      <ns:getRepositories/>
   </soapenv:Body>
</soapenv:Envelope>
——=_Part_2_27870721.1460556134511–



Both of these requests should be valid. If Alfresco is hooked up to multipart messages, then why responses are not multipart encoded?
I understand that supporting MTOM is significant improvement, but <strong>why requesting all messages to be MTOM encoded?</strong> MTOM encoding should be logical only for stream (attachment) related messages?

Thanks,
Boris

Outcomes