我正试图通过以下路径获取文件夹ID:
Folder folder = (Folder) getCmisSession().getObjectByPath(folderPath);
我请求的路径是:
/SIGAP/2011/DIRECCIÓN GENERAL DE PRUEBAS/SIN EXPEDIENTE/2010001231
正如你所看到的,字符串中有一个特殊的字符Ó
,
引发化学反应的错误是:
STACK TRACE:
org.cmis.ws.CmisException: Not found an object for the specific path: /SIGAP/2011/DIRECCIÃ?N GENERAL DE PRUEBAS/OFICIOS
at com.emc.documentum.fs.cmis.impl.dfs.utils.CmisExceptionFactory.create(CmisExceptionFactory.java:24)
at com.emc.documentum.fs.cmis.impl.dfs.utils.CmisExceptionBuilder.build(CmisExceptionBuilder.java:31)
at com.emc.documentum.fs.cmis.impl.dfs.action.GetObjectByPathAction.getNonCabinetObjectByPath(GetObjectByPathAction.java:170)
它将字符串从DIRECCIÓN
更改为DIRECCIÃ?N
,
如何将会话的字符集设置为utf-8?或者我必须如何对路径进行编码?
更新1:
正如@FlorianMüller建议的那样,在SoapUI的帮助下,我尝试通过以下路径请求相同的文件夹:
<soapenv:Body>
<ns:getObjectByPath>
<ns:repositoryId>LHD_ECM</ns:repositoryId>
<ns:path>/SIGAP/2011/DIRECCIÓN GENERAL DE PRUEBAS/SIN EXPEDIENTE/2010001231</ns:path>
</ns:getObjectByPath>
</soapenv:Body>
并得到了服务器正确的:
<S:Body>
<ns2:getObjectByPathResponse xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/messaging/200908/">
<ns2:object>
<properties>
<propertyString queryName="cmis:name" displayName="Name" localName="object_name" propertyDefinitionId="cmis:name">
<value>2010001231</value>
</propertyString>
<propertyId queryName="cmis:objectTypeId" displayName="Object Type ID" localName="r_object_type" propertyDefinitionId="cmis:objectTypeId">
<value>sigapfolio</value>
</propertyId>
<propertyId queryName="cmis:baseTypeId" displayName="Base Type Id" localName="" propertyDefinitionId="cmis:baseTypeId">
<value>cmis:folder</value>
</propertyId>
<propertyId queryName="cmis:objectId" displayName="Object Id" localName="r_object_id" propertyDefinitionId="cmis:objectId">
<value>0b00020280080815</value>
</propertyId>
<propertyString queryName="cmis:createdBy" displayName="Created By" localName="r_creator_name" propertyDefinitionId="cmis:createdBy">
<value>dmadmin</value>
</propertyString>
<propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="r_creation_date" propertyDefinitionId="cmis:creationDate">
<value>2016-04-05T04:54:44.000-05:00</value>
</propertyDateTime>
<propertyString queryName="cmis:lastModifiedBy" displayName="Last Modified By" localName="r_modifier" propertyDefinitionId="cmis:lastModifiedBy">
<value>dmadmin</value>
</propertyString>
<propertyDateTime queryName="cmis:lastModificationDate" displayName="Last Modification Date" localName="r_modify_date" propertyDefinitionId="cmis:lastModificationDate">
<value>2016-04-05T04:54:44.000-05:00</value>
</propertyDateTime>
<propertyString queryName="cmis:changeToken" displayName="Change Token" localName="i_vstamp" propertyDefinitionId="cmis:changeToken">
<value>1</value>
</propertyString>
<propertyId queryName="cmis:parentId" displayName="Parent Id" localName="i_folder_id" propertyDefinitionId="cmis:parentId">
<value>0b00020280005a3b</value>
</propertyId>
<propertyString queryName="cmis:path" displayName="Folder Path" localName="r_folder_path" propertyDefinitionId="cmis:path">
<value>/SIGAP/2011/DIRECCIÓN GENERAL DE PRUEBAS/SIN EXPEDIENTE/2010001231</value>
</propertyString>
<propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Object Type IDs" localName="" propertyDefinitionId="cmis:allowedChildObjectTypeIds">
<value>cmis:folder</value>
<value>cmis:document</value>
</propertyId>
</properties>
</ns2:object>
</ns2:getObjectByPathResponse>
</S:Body>
</S:Envelope>
所以Apache Chemistry肯定有问题:(
所以问题在于绑定,从AtomPub切换到Web服务,问题就消失了。
parameter.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());