03-09-2009 11:25 AM
10:16:17,301 User:admin ERROR [repo.cmis.ws] org.alfresco.error.AlfrescoRuntimeException: The type is not supported by this service: {http://www.alfresco.org/model/cmis/0.5}Folder"
public String serviceCreateFolder(String repositoryId, String parentId) throws Exception {
ObjectFactory objectFactory = new ObjectFactory();
CmisPropertiesType folderProperties = objectFactory.createCmisPropertiesType();
List<CmisProperty> folderPropertiesList = folderProperties.getProperty();
folderPropertiesList = addPropertyValue(folderPropertiesList, objectFactory, "Name", "Test CMIS-created Folder");
String response = this.objectServicePort.createFolder(repositoryId, "Folder", folderProperties, "workspace://SpacesStore/aeac5cce-6f36-40be-b894-b9cee182457b");
return response;
}
private List<CmisProperty> addPropertyValue(List<CmisProperty> propertyList, ObjectFactory objectFactory, String name, String value) {
CmisPropertyString property = objectFactory.createCmisPropertyString();
property.setName(name);
property.setValue(value);
propertyList.add(property);
return propertyList;
}
<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" soap:mustUnderstand="1"><wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-12440295"><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2009-03-09T15:16:17.238Z</wsu:Created><wsu:Expires xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2009-03-09T15:21:17.238Z</wsu:Expires></wsu:Timestamp><wsse:UsernameToken xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-10887413"><wsse:Username xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">admin</wsse:Username><wsse:Password xmlns:wsse="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#PasswordDigest">TOWh2S6RurKrD+LjsH/5JaiQxfc=</wsse:Password><wsse:Nonce xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">3dlDOjUtlru9Jd67gPUVKA==</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2009-03-09T15:16:17.238Z</wsu:Created></wsse:UsernameToken></wsse:Security></soap:Header><soap:Body><ns1:createFolder xmlns:ns1="http://www.cmis.org/2008/05"><ns1:repositoryId><Unknown</ns1:repositoryId><ns1:typeId>Folder</ns1:typeId><ns1:properties><ns1:propertyString ns1:name="Name"><ns1:value>Test CMIS-created Folder</ns1:value></ns1:propertyString></ns1:properties><ns1:folderId>workspace://SpacesStore/aeac5cce-6f36-40be-b894-b9cee182457b</ns1:folderId></ns1:createFolder></soap:Body></soap:Envelope>
03-09-2009 02:49 PM
13:46:46,566 User:admin ERROR [repo.cmis.ws] org.alfresco.error.AlfrescoRuntimeException: The type is not supported by this service: {http://www.alfresco.org/model/cmis/0.5}Document
public String serviceCreateDocument(String repositoryId, String parentId, String filePath, String fileName) throws Exception {
ObjectFactory objectFactory = new ObjectFactory();
CmisPropertiesType documentProperties = objectFactory.createCmisPropertiesType();
List<CmisProperty> documentPropertiesList = documentProperties.getProperty();
documentPropertiesList = addPropertyValue(documentPropertiesList, objectFactory, "Name", "Test CMIS-created Document");
CmisContentStreamType cmisContentStreamType = objectFactory.createCmisContentStreamType();
DataHandler handler = new DataHandler(new FileInputStream(new File(filePath + "/" + fileName)), fileName);
cmisContentStreamType.setStream(handler);
cmisContentStreamType.setFilename(fileName);
String response = this.objectServicePort.createDocument(repositoryId, "Document", documentProperties, "workspace://SpacesStore/aeac5cce-6f36-40be-b894-b9cee182457b", cmisContentStreamType, EnumVersioningState.MAJOR);
return response;
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.