cancel
Showing results for 
Search instead for 
Did you mean: 

moveObject Service

jbaldo
Champ in-the-making
Champ in-the-making
Hello,

I am trying to implement the moveObject CMIS service in Alfresco from Drupal but I don't see any documentation for it here:

http://localhost:8080/alfresco/service/index/family/CMIS

I'm using this XML as defined in the CMIS schema and the Alfresco CMIS Web Service WSDL:
 $postvars = '<?xml version="1.0" encoding="utf-8"?>' .
  '<entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmis="http://www.cmis.org/2008/05">' .
  '<cmis:moveObject>' .
      '<cmis:repositoryId>' . $repositoryId . '</cmis:repositoryId>' .
      '<cmis:objectId>' . $objId['noderef'] . '</cmis:objectId>' .
    '<cmis:targetFolderId>' . $targetId['noderef'] . '</cmis:targetFolderId>' .
    '<cmis:sourceFolderId>' . $sourceId['noderef'] . '</cmis:sourceFolderId>' .
  '</cmis:moveObject>' .
  '</entry>';

  $header[] = 'Content-type: application/atom+xml;type=entry';
  $header[] = 'Content-length: ' . strlen($postvars);
  $header[] = 'MIME-Version: 1.0';

This gives me a 405 error when I POST to the URL:

/api/node/{storeType}/{storeId}/{Id}
(where the Id belongs to the object being moved)

I'm guessing this is because the URL is incorrect.  Does anyone have a working example or know what the correct URL format is for moveObject requests?

Thanks for any help.
2 REPLIES 2

jbaldo
Champ in-the-making
Champ in-the-making
It works in SoapUI.  How can I do the same in using this php API?  Is the post URL different?

http://drupal.org/project/cmis

Request:
POST http://localhost:8080/alfresco/cmis/ObjectService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:8080
Content-Length: 1624

<soapenv:Envelope xmlns:ns="http://docs.oasis-open.org/ns/cmis/messaging/200901" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header><wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsu:Timestamp wsu:Id="Timestamp-12" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsu:Created>2009-07-07T19:05:18.181Z</wsu:Created><wsu:Expires>2009-07-07T20:28:38.181Z</wsu:Expires></wsu:Timestamp><wsse:UsernameToken wsu:Id="UsernameToken-11" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:Username>admin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">admin</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">5Za6J9TsuZcN5xFaQwmUAQ==</wsse:Nonce><wsu:Created>2009-07-07T19:05:18.181Z</wsu:Created></wsse:UsernameToken></wsse:Security></soapenv:Header>
   <soapenv:Body>
      <ns:moveObject>
         <ns:repositoryId>98c822f8-af77-4d86-b959-3564b1c89bb2</ns:repositoryId>
         <ns:objectId>workspace://SpacesStore/464f9b72-04ee-4e55-b03b-a863ed4c88d3</ns:objectId>
         <ns:targetFolderId>workspace://SpacesStore/6df502cf-7850-41e4-a1f6-c1f2ebd5c439</ns:targetFolderId>
         <ns:sourceFolderId>workspace://SpacesStore/ad60c295-038e-442f-9577-437b36fa41e0</ns:sourceFolderId>
      </ns:moveObject>
   </soapenv:Body>
</soapenv:Envelope>

———————————————————————–

Response:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: multipart/related; type="application/xop+xml"; boundary="—-=_Part_0_32855370.1246993519601"; start="<root.message@cxf.apache.org>"; start-info="text/xml"
Content-Length: 1081
Date: Tue, 07 Jul 2009 19:05:19 GMT


——=_Part_0_32855370.1246993519601
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml";
Content-Transfer-Encoding: binary
Content-ID: <root.message@cxf.apache.org>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-26360384"><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2009-07-07T19:05:19.773Z</wsu:Created><wsu:Expires xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2009-07-07T19:10:19.773Z</wsu:Expires></wsu:Timestamp></wsse:Security></soap:Header><soap:Body><moveObjectResponse xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200901" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200901" /></soap:Body></soap:Envelope>
——=_Part_0_32855370.1246993519601–

——————————

Web Service URL:
POST http://localhost:8080/alfresco/cmis/ObjectService

syberyan
Champ in-the-making
Champ in-the-making
Any luck with this? I'm desperately trying to find out how to move an object over CMIS REST.
After looking through the source code, my guess is that it's just not implemented… *sigh*