2012-05-02 81 views
0

我正在嘗試使用CMIS wsdl在SharePoint存儲庫中創建文檔。但出現一些錯誤。我正在使用soapui來調用服務。調用CMIS服務時收到錯誤

下面是被創建的XML的一部分:

Request : <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/> 
    <soapenv:Body> 
     <ns:createDocument> 
     <!--Optional:--> 
     <ns:repositoryId>64bec929-945e-46f1-9c74-d0ab24803283</ns:repositoryId> 
     <!--Optional:--> 
     <ns:properties> 
      <propertyString propertyDefinitionId="cmis:name" localName="FileLeafRef" displayName="Name" queryName="cmis:name"> 
       <value>test.txt</value> 
      </propertyString> 
      <propertyId propertyDefinitionId="cmis:objectId" localName="cmis:objectId" displayName="cmis:objectId" queryName="cmis:objectId"> 
       <value>123123</value> 
      </propertyId> 
      <propertyId propertyDefinitionId="cmis:baseTypeId" localName="cmis:baseTypeId" displayName="cmis:baseTypeId" queryName="cmis:baseTypeId"> 
       <value>cmis:document</value> 
      </propertyId> 
      <propertyId propertyDefinitionId="cmis:objectTypeId" localName="cmis:objectTypeId" displayName="cmis:objectTypeId" queryName="cmis:objectTypeId"> 
       <value>cmis:document</value> 
      </propertyId> 
      <propertyBoolean propertyDefinitionId="cmis:isImmutable" localName="cmis:isImmutable" displayName="cmis:isImmutable" queryName="cmis:isImmutable"> 
       <value>true</value> 
      </propertyBoolean> 
      <propertyBoolean propertyDefinitionId="cmis:isLatestVersion" localName="cmis:isLatestVersion" displayName="cmis:isLatestVersion" queryName="cmis:isLatestVersion"> 
       <value>true</value> 
      </propertyBoolean> 
      <propertyBoolean propertyDefinitionId="cmis:isMajorVersion" localName="cmis:isMajorVersion" displayName="cmis:isMajorVersion" queryName="cmis:isMajorVersion"> 
       <value>true</value> 
      </propertyBoolean> 
      <propertyBoolean propertyDefinitionId="cmis:isLatestMajorVersion" localName="cmis:isLatestMajorVersion" displayName="cmis:isLatestMajorVersion" queryName="cmis:isLatestMajorVersion"> 
       <value>true</value> 
      </propertyBoolean> 
      <propertyString propertyDefinitionId="cmis:versionLabel" localName="cmis:versionLabel" displayName="cmis:versionLabel" queryName="cmis:versionLabel"> 
       <value>1.0</value> 
      </propertyString> 
      <propertyId propertyDefinitionId="cmis:versionSeriesId" localName="cmis:versionSeriesId" displayName="cmis:versionSeriesId" queryName="cmis:versionSeriesId"> 
       <value>1</value> 
      </propertyId> 
      <propertyBoolean propertyDefinitionId="cmis:isVersionSeriesCheckedOut" localName="cmis:isVersionSeriesCheckedOut" displayName="cmis:isVersionSeriesCheckedOut" queryName="cmis:isVersionSeriesCheckedOut"> 
       <value>true</value> 
      </propertyBoolean> 
      <propertyInteger propertyDefinitionId="cmis:contentStreamLength" localName="File_x0020_Size" displayName="File Size" queryName="cmis:contentStreamLength"> 
       <value>19444</value> 
      </propertyInteger> 
      <propertyString propertyDefinitionId="cmis:contentStreamMimeType" localName="cmis:contentStreamMimeType" displayName="cmis:contentStreamMimeType" queryName="cmis:contentStreamMimeType"> 
       <value>text/plain</value> 
      </propertyString> 
      <propertyString propertyDefinitionId="cmis:contentStreamFileName" localName="FileLeafRef" displayName="Name" queryName="cmis:contentStreamFileName"> 
       <value>test.txt</value> 
      </propertyString> 
     </ns:properties> 
     <ns:folderId/> 
     <ns:contentStream> 
      <!--Optional:--> 
      <ns:length>19444</ns:length> 
      <!--Optional:--> 
      <ns:mimeType>text/plain</ns:mimeType> 
      <!--Optional:--> 
      <ns:filename>a1.txt</ns:filename> 
      <!--Optional:--> 
      <ns:stream>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</ns:stream> 
     </ns:contentStream> 
     <ns:versioningState>major</ns:versioningState> 
     <!--Zero or more repetitions:--> 
     <ns:policies/> 
     <ns:addACEs> 
      <!--Zero or more repetitions:--> 
      <ns1:permission> 
       <!--Optional:--> 
       <ns1:principal> 
        <!--Optional:--> 
        <ns1:principalId/> 
       </ns1:principal> 
       <!--Zero or more repetitions:--> 
       <ns1:permission>cmis:all</ns1:permission> 
       <ns1:direct>false</ns1:direct> 
      </ns1:permission> 
     </ns:addACEs> 
     <ns:removeACEs/> 
     <ns:extension/> 
     </ns:createDocument> 
    </soapenv:Body> 
</soapenv:Envelope> 

響應我得到的回覆是:

<faultcode>s:constraint</faultcode> 
      <faultstring>The operation violates a Repository- or Object-level constraint defined in the CMIS domain model.</faultstring> 
      <detail> 
       <cmisFault xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> 
        <code>409</code> 
        <message>The operation violates a Repository- or Object-level constraint defined in the CMIS domain model.</message> 
        <type>constraint</type> 
       </cmisFault> 
      </detail> 
      </s:Fault> 

請幫助...

+0

此文章對您沒有幫助嗎? http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/2cdc5c06-85e1-4b4d-ae93-9c0a8b336738 – Ken

回答

1

您試圖設置只讀只有cmis:object:id,cmis:versionSeriesId等屬性。檢查CMIS規範哪些屬性是讀寫屬性。

0

您需要確保您的版本控制參數與SharePoint上啓用的參數相匹配

相關問題