English 中文(简体)
curl query to check out a document using CMIS
原标题:

I am trying to checkout a document using the REST-based CMIS protocol, but I get an error from the server (Alfresco).

Am I misusing curl? Or am I missing something in my request?

curl --user admin:admin -F "atomentry=@atomentry.xml" http://localhost:8080/alfresco/service/cmis/checkedout

With atomentry.xml being:

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/"
xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/">
<cmisra:object>
<cmis:properties>
<cmis:propertyId propertyDefinitionId="cmis:objectId">
<cmis:value>workspace://SpacesStore/3e13d089-39cf-48a4-b0b6-773b602bbcc0</cmis:value>
</cmis:propertyId>
</cmis:properties>
</cmisra:object>
</entry>
最佳回答

I was wrong with both curl and the XML... here is what worked:

curl -X POST -uadmin:admin "http://localhost:8080/alfresco/s/cmis/checkedout" -H "Content-Type:application/atom+xml;type=entry;charset=UTF-8" -d @atomentry.xml

With atomentry.xml being:

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/">
<cmisra:object>
<cmis:properties>
<cmis:propertyId propertyDefinitionId="cmis:objectId">
<cmis:value>workspace://SpacesStore/3e13d089-39cf-48a4-b0b6-773b602bbcc0</cmis:value>
</cmis:propertyId>
</cmis:properties>
</cmisra:object>
</entry>
问题回答

暂无回答




相关问题
curl + sessions

I m making POST requests with CURL, and I would like to output cookies made during that request... Is that possible? :)

Curl setting Content-Type incorrectly

I am running a curl operation on the command line and am having trouble forcing the header to set as XML. I use the -H option to force the Content-Type to be xml, however, once I run the command I can ...

Create new etherpad using PHP and CURL

I m trying to write a simple PHP script which automatically sets up new etherpads (see http://etherpad.com/). They don t have an API (yet) for creating new pads so I m trying to figure if I can do ...

Finding out where curl was redirected

I m using curl to make php send an http request to some website somewhere and have set CURLOPT_FOLLOWLOCATION to 1 so that it follows redirects. How then, can I find out where it was eventually ...

热门标签