cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 5.0 Integration through SOAP protocol removed? Alternatives?

a_palm
Champ in-the-making
Champ in-the-making
Hi,

I have this application and I am trying to communicate with Alfresco through SOAP. At the link below, I noticed this message: <strong>Please note that this API has been superceded by CMIS (specifically, the CMIS SOAP binding). It's use is no longer recommended. This functionality was removed from Alfresco in 5.0.b…..This API was removed in Alfresco 5.0 and is no longer available. Use the CMIS web services bindings instead. </strong>

Does this mean that in Alfresco 5.0, I can no longer use SOAP to communicate with Alfresco? What are the other options to communicate through Alfresco and manage your content? I already tried the Java API client CMIS workbench and the other APIs on the site http://chemistry.apache.org/, Shareprotocol, WebdAV, google docs… Are those the alternative to using SOAP or are their other ways to communicate with Alfresco?

Thanks in Advance.

Link: https://wiki.alfresco.com/wiki/Alfresco_Content_Management_Web_Services
5 REPLIES 5

mrogers
Star Contributor
Star Contributor
No.    You can still use SOAP but you can't use the old SOAP API.

CMIS has a SOAP binding if you really, really must use it.   But hopefully with projects like Chemistry you should not need to worry about the binding used or mess around with all that low level stuff.

Or you can add your own SOAP services to alfresco (even the old obsolete ones that were just removed!)

a_palm
Champ in-the-making
Champ in-the-making
Thank you for your reply.

I am an intern and I got this assignment to create a POC which involves a link/connection from  Alfresco to a web application program. This link to Alfresco needs to be done using SOAP services. I need to create this POC first to make sure this link/connection is possible. The company really wants to make the link to Alfresco using SOAP services.

I still have some questions and I hope you or anyone else are able to answer them. I tried to make the connection to Alfresco using soap, but I got this error: "<strong>..the request is not mtom encoded..</strong>". Do you know what the cause of this error might be? I also want to try to make the SOAP request handler file, but I don't know how to build this file. If you know what needs to be written in the file (the format of SOAP message) or a links that explains how to make it, it could be very helpful. I would also like to know if there is a way to enable/disable this <strong>MTOM</strong>

You said in your response that I can also add my own SOAP services to Alfresco (even the old ones that were just removed). Where can I find these old files? I would like these files as an example/guide

Thank you so much for your time. I really appreciate it

Arthur


<strong>Edit:</strong>
I uploaded the SOAP request I made in SOAP UI and also the response I got from this request.

<strong>SOAPUI request</strong>
<blockcode>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns1="http://docs.oasis-open.org/ns/cmis/core/200908/">
   <soapenv:Header>
      <wsseSmiley Frustratedecurity soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken
      wsu:Id="UsernameToken-666"
      xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>admin</wsse:Username>
            <wsseSmiley Tongueassword>1234</wsseSmiley Tongueassword>
         </wsse:UsernameToken>
      </wsseSmiley Frustratedecurity>
   </soapenv:Header>
   <soapenv:Body>
      <ns:createFolder>
         <ns:repositoryId>a178a092-c119-4df2-8b98-aeae2582c889</ns:repositoryId>
         <nsSmiley Tongueroperties>
            <ns1Smiley TongueropertyString propertyDefinitionId="cmis:name">
               <ns1:value>MyFirstCreateFolderThroughSOAP</ns1:value>
            </ns1Smiley TongueropertyString>
            <ns1Smiley TongueropertyId propertyDefinitionId="cmisSmiley SurprisedbjectTypeId">
               <ns1:value>cmis:folder</ns1:value>
            </ns1Smiley TongueropertyId>
         </nsSmiley Tongueroperties>
         <ns:folderId>9560f444-4af2-4daa-98dd-3791a30207eb</ns:folderId>
      </ns:createFolder>
   </soapenv:Body>
</soapenv:Envelope>
</blockcode>

<strong>SOAPUI response from Alfresco</strong>
<blockcode>
<S:Envelope xmlnsSmiley Frustrated="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <S:Fault>
         <faultcode>S:Client</faultcode>
         <faultstring>The request is not MTOM encoded.</faultstring>
         <detail>
            <cmisFault xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/">
               <type>runtime</type>
              
0

               <message>The request is not MTOM encoded.</message>
            </cmisFault>
         </detail>
      </S:Fault>
   </S:Body>
</S:Envelope>
</blockcode>

a_palm
Champ in-the-making
Champ in-the-making
I think I actually fixed the problem…

After searching ho wto enable this MTOM for a while, I found some information on this link: <a>http://cxf.apache.org/docs/mtom.html#MTOM-EnablingMTOM</a> . MTOM needs to be enabled on both the client and the server. I checked at the Alfresco server in the file called <strong>sun-jaxws.xml</strong> (location: C:\Alfresco\tomcat\webapps\chemistry-opencmis-server-inmemory-0.12.0\WEB-INF ). MTOM is already enabled there. I also needed to enable MTOM in SOAPUI ( <a> http://www.soapui.org/SOAP-and-WSDL/adding-headers-and-attachments.html </a> ). Then SOAP request was succesful.

<strong>Response:</strong>
<blockcode>
<S:Envelope xmlnsSmiley Frustrated="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Header>
    <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <Created>2014-11-19T16:06:23.756Z</Created>
        <Expires>2014-11-20T16:06:23.756Z</Expires>
      </Timestamp>
    </Security>
  </S:Header>
  <S:Body>
    <createFolderResponse xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200908/">
      <objectId>workspace://SpacesStore/efdb0591-8060-4285-9ed8-0f1442f2007a</objectId>
    </createFolderResponse>
  </S:Body>
</S:Envelope>
</blockcode>

Just one thing: I don't understand why
 <Expires>2014-11-20T16:06:23.756Z</Expires> 

generic1
Champ in-the-making
Champ in-the-making
Thanks for your post - I run into the same problem - but with adjusting MTOM it works fine with SOAPUI.
But I still have one problem. After I set up SOAP- Request I get the following response at bottom.

I don't know how to authenticate in order to get a SOAP response instead of the exception currently.

PS: I have downloaded the Alfresco Trial Version 5.0.0.

Thanks for response!
Generic1


<S:Envelope xmlnsSmiley Frustrated="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Header>
      <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <Created>2015-02-01T06:16:18.014Z</Created>
            <Expires>2015-02-02T06:16:18.014Z</Expires>
         </Timestamp>
      </Security>
   </S:Header>
   <S:Body>
      <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
         <faultcode>SSmiley Frustratederver</faultcode>
         <faultstring>01010027 Failed to authenticate</faultstring>
         <detail>
            <cmisFault:cmisFault xmlns:cmisFault="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200908/">
               <type>permissionDenied</type>
               <code>0
               <message>01010027 Failed to authenticate</message>
               <stacktrace:stacktrace xmlns:stacktrace="http://chemistry.apache.org/opencmis/exception" xmlns="http://chemistry.apache.org/opencmis/exception">org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException: 01010027 Failed to authenticate
   at org.alfresco.opencmis.AlfrescoCmisExceptionInterceptor.invoke(AlfrescoCmisExceptionInterceptor.java:105)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at com.sun.proxy.$Proxy301.getRepositoryInfos(Unknown Source)
   at org.apache.chemistry.opencmis.server.support.wrapper.ConformanceCmisServiceWrapper.getRepositoryInfos(ConformanceCmisServiceWrapper.java:531)
   at org.apache.chemistry.opencmis.server.impl.webservices.Repos
</code>

a_palm
Champ in-the-making
Champ in-the-making
Hi,
Sorry for my very late reply.

I used SOAPUI just for testing purposes, to know if the SOAP request message is accordingly.

I had to make a separate stylesheet for the header, which include the authentication part. It is pretty much the same as the header I wrote in my last post. I just needed to include the username and password.

Just add the following part after the "<strong>wsu:Timestamp</strong>" TAG and it should work. Remember to add the required authentication details.

<blockcode>
     <wsse:UsernameToken wsu:Id="UsernameToken-666" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
          <wsse:Username>INSERT-YOUR-USERNAME-HERE</wsse:Username>
          <wsseSmiley Tongueassword>INSERT-YOUR-PASSWORD-HERE</wsseSmiley Tongueassword>
     </wsse:UsernameToken>
</blockcode>