07-28-2010 08:23 AM
Exception in thread "main" org.oasis_open.docs.ns.cmis.ws._200908.CmisException: Type Id property required
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:130)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
at $Proxy41.createFolder(Unknown Source)
at com.globolog.teamup.uag.client.CMISClient.main(CMISClient.java:61)
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
S:mustUnderstand="1">
<wsu:Timestamp
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Created>2010-07-28T12:13:58.881Z</wsu:Created>
<wsu:Expires>2010-07-28T12:22:18.881Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken>
<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:UsernameToken>
</wsse:Security>
</S:Header>
<S:Body>
<createFolder xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/"
xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200908/"
xmlns:ns3="http://www.alfresco.org">
<repositoryId>1fe8cf3a-58c3-40ba-916a-993c863c05a4</repositoryId>
<properties>
<ns2:cmisPropertyId propertyDefinitionId="cmis:objectTypeId">
<ns2:value>cmis:folder</ns2:value>
</ns2:cmisPropertyId>
</properties>
<folderId>workspace://SpacesStore/a869c344-f5cb-4b9d-bf42-2c74de9a44c3
</folderId>
</createFolder>
</S:Body>
</S:Envelope>
ApplicationContext context = new ClassPathXmlApplicationContext();
XmlBeanFactory factory = new XmlBeanFactory(context.getResource(APPLICATION_CONTEXT_XML));
WebServiceFactory wsFactory = (WebServiceFactory) factory.getBean("webServiceFactory");
RepositoryServicePort repositoryServicePort = wsFactory.getRepositoryServicePort();
List<CmisRepositoryEntryType> repositoryList = repositoryServicePort.getRepositories(null);
String repositoryId = repositoryList.get(0).getRepositoryId();
CmisRepositoryInfoType repositoryInfo = repositoryServicePort.getRepositoryInfo(repositoryId, null);
ObjectServicePort objectServicePort = wsFactory.getObjectServicePort();
ObjectFactory objectFactory = new ObjectFactory();
CmisPropertiesType properties = objectFactory.createCmisPropertiesType();
List<Object> propertyList = properties.getAny();
CmisPropertyId propertyId = objectFactory.createCmisPropertyId();
propertyId.setPropertyDefinitionId("cmis:objectTypeId");
propertyId.getValue().add("cmis:folder");
propertyList.add(propertyId);
Holder<String> idHolder = new Holder<String>();
objectServicePort.createFolder(repositoryId, properties, repositoryInfo.getRootFolderId(), null, null, null, null, idHolder);
07-29-2010 12:00 PM
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.