Alfresco Extensions problem when using webservices binding

187 views
Skip to first unread message

mkl

unread,
May 11, 2011, 10:34:13 AM5/11/11
to Alfresco OpenCMIS Extension
Re-posted from the d...@chemistry.apache.org mailing list as hinted at
by Florian:

Hello!

Currently I’m working on a project which involves pushing documents
via CMIS into an Alfresco installation (Community - v3.4.0 (d 3370))
and adding custom information in aspect properties.

The versions I’m using are OpenCMIS 0.3.0 in combination with the
Alfresco-OpenCMIS-Extension 0.2.

I started out using atompub binding and everything worked fine. Now
I’ve been asked to switch to webservices binding. Since I did so
(merely changing the session parameters), the aspects and aspect
properties contained in the document creation call have been ignored
while a simple document node with the document itself is created all
right. Unfortunately I get no failure message anywhere.

For document creation I’m making use of the Alfresco-OpenCMIS-
Extension option to include additional aspects in the
cmis:objectTypeId parameter and values for the aspect properties in
the createDocument map, e.g. {ad:keywords=[keyword],
cmis:objectTypeId=cmis:document,P:ad:myaspect, cmis:name=Test 1.pdf,
ad:transactionId=a2b59a6b81bb8ae6e} where ad:myaspect is an aspect
with a multi-value property ad:keywords and a single-value property
ad:transactionId.

Has anyone else had this problem and maybe found a solution?

Regards, Michael.

mkl

unread,
May 11, 2011, 10:44:38 AM5/11/11
to Alfresco OpenCMIS Extension
Testing again with more logging activated, Alfresco log files include
information on the aspect and aspect parameters in the incoming SOAP
message:

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="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 xmlns="http://docs.oasis-open.org/wss/2004/01/
oasis-200401-wss-wssecurity-utility-1.0.xsd">2011-05-11T14:26:30Z</
Created>
<Expires xmlns="http://docs.oasis-open.org/wss/2004/01/
oasis-200401-wss-wssecurity-utility-1.0.xsd">2011-05-12T14:26:30Z</
Expires>
</Timestamp>
<UsernameToken xmlns="http://docs.oasis-open.org/wss/2004/01/
oasis-200401-wss-wssecurity-secext-1.0.xsd">
<Username xmlns="http://docs.oasis-open.org/wss/2004/01/
oasis-200401-wss-wssecurity-secext-1.0.xsd">admin</Username>
<Password xmlns="http://docs.oasis-open.org/wss/2004/01/
oasis-200401-wss-wssecurity-secext-1.0.xsd" Type="http://docs.oasis-
open.org/wss/2004/01/oasis-200401-wss-username-token-
profile-1.0#PasswordText">XXXXXX</Password>
<Created xmlns="http://docs.oasis-open.org/wss/2004/01/
oasis-200401-wss-wssecurity-utility-1.0.xsd">2011-05-11T14:26:30Z</
Created>
</UsernameToken>
</Security>
</S:Header>
<S:Body>
<ns2:createDocument xmlns:ns2="http://docs.oasis-open.org/ns/cmis/
messaging/200908/" xmlns="http://docs.oasis-open.org/ns/cmis/core/
200908/">
<ns2:repositoryId>aeca7dc3-289b-41b8-9be5-8f8611de4c4a</
ns2:repositoryId>
<ns2:properties>
<propertyId propertyDefinitionId="cmis:objectTypeId">
<value>cmis:document</value>
</propertyId>
<propertyString propertyDefinitionId="cmis:name">
<value>Test 2.pdf</value>
</propertyString>
<setAspects:setAspects xmlns="http://www.alfresco.org"
xmlns:setAspects="http://www.alfresco.org">
<aspectsToAdd>P:ad:myaspect</aspectsToAdd>
<properties>
<propertyString xmlns:propertyDefinitionId="http://
docs.oasis-open.org/ns/cmis/core/200908/" xmlns="http://docs.oasis-
open.org/ns/cmis/core/200908/"
propertyDefinitionId:propertyDefinitionId="ad:keywords">
<propertyDefinitionId:value>keyword</
propertyDefinitionId:value>
</propertyString>
<propertyString xmlns:propertyDefinitionId="http://
docs.oasis-open.org/ns/cmis/core/200908/" xmlns="http://docs.oasis-
open.org/ns/cmis/core/200908/"
propertyDefinitionId:propertyDefinitionId="ad:transactionId">
<propertyDefinitionId:value>3d4e4316da28304d8</
propertyDefinitionId:value>
</propertyString>
</properties>
</setAspects:setAspects>
</ns2:properties>
<ns2:folderId>workspace://SpacesStore/2984e980-caa4-403d-a899-
f606cd2a96a4</ns2:folderId>
<ns2:contentStream>
<ns2:length>108379</ns2:length>
<ns2:mimeType>application/pdf</ns2:mimeType>
<ns2:filename>Test 2.pdf</ns2:filename>
<ns2:stream>
<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/
include" href="cid:
17413433-6ea1-41b3...@example.jaxws.sun.com" />
</ns2:stream>
</ns2:contentStream>
<ns2:versioningState>none</ns2:versioningState>
</ns2:createDocument>
</S:Body>
</S:Envelope>

Florian Müller

unread,
May 11, 2011, 12:20:31 PM5/11/11
to alfresco-open...@googlegroups.com
I've re-tested it and it works me.
I'm not sure how I can help you with that. The SOAP content looks alright. And I cannot debug the server as long as I cannot reproduce this behavior. 

Florian

mkl

unread,
May 12, 2011, 9:52:28 AM5/12/11
to Alfresco OpenCMIS Extension
Ok, the problem is resolved for now, at least as far as Chemistry, the
Alfresco-OpenCMIS-Extensions, and Alfresco itself are concerned.

It was a classpath issue: Xalan 2.7.1 was on the classpath, and once
it was removed, pushing documents into the DMS started working fine.

This is not the end of it for me, though, as there was a reason why
Xalan was on the classpath... <sigh>

To prevent such trouble, OpenCMIS or the extensions might start trying
to look for XML libraries on the classpath which meet their needs.
Maybe the factories have flags which allow for a proper selection...

Thanks for looking into the issue!

Regards, Michael.

mkl

unread,
May 13, 2011, 4:04:04 AM5/13/11
to Alfresco OpenCMIS Extension
A final posting on this...

The essential difference between the createDocument SOAP with Xalan
(not accepted by Alfresco) and those without (accepted by Alfresco)
was inside the setAspects element:

with Xalan:

<setAspects:setAspects xmlns="http://www.alfresco.org"
xmlns:setAspects="http://www.alfresco.org">
<aspectsToAdd>P:ad:signamus</aspectsToAdd>
<properties>
<propertyString
xmlns:propertyDefinitionId="http://docs.oasis-open.org/ns/cmis/
core/200908/"
xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/"
propertyDefinitionId:propertyDefinitionId="ad:keywords">
<propertyDefinitionId:value>keyword</propertyDefinitionId:value>
</propertyString>
<propertyString
xmlns:propertyDefinitionId="http://docs.oasis-open.org/ns/cmis/
core/200908/"
xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/"
propertyDefinitionId:propertyDefinitionId="ad:transactionId">
<propertyDefinitionId:value>a1db908ecc16972de</
propertyDefinitionId:value>
</propertyString>
</properties>
</setAspects:setAspects>

without Xalan:

<setAspects:setAspects xmlns="http://www.alfresco.org"
xmlns:setAspects="http://www.alfresco.org">
<aspectsToAdd>P:ad:signamus</aspectsToAdd>
<properties>
<propertyString
xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/"
xmlns:ns0="http://docs.oasis-open.org/ns/cmis/core/200908/"
propertyDefinitionId="ad:keywords">
<value>keyword</value>
</propertyString>
<propertyString
xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/"
xmlns:ns0="http://docs.oasis-open.org/ns/cmis/core/200908/"
propertyDefinitionId="ad:transactionId">
<value>a1db908ecc16972de</value>
</propertyString>
</properties>
</setAspects:setAspects>

XML-wise, as long as namespaces are properly supported both in element
and attribute names, this looks equivalent to me... not to Alfresco,
though.

Regards, Michael
Reply all
Reply to author
Forward
0 new messages