Merge from DEV/SEAMIST3

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10832 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2008-09-07 13:06:28 +00:00
parent 64bf87af37
commit a42cc8992f
51 changed files with 4046 additions and 352 deletions

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/cxf-2.1.2.jar"/>
<classpathentry kind="lib" path="lib/FastInfoset-1.2.2.jar"/>
<classpathentry kind="lib" path="lib/geronimo-activation_1.1_spec-1.0.2.jar"/>
<classpathentry kind="lib" path="lib/geronimo-annotation_1.0_spec-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/geronimo-javamail_1.4_spec-1.3.jar"/>
<classpathentry kind="lib" path="lib/geronimo-jaxws_2.1_spec-1.0.jar"/>
<classpathentry kind="lib" path="lib/geronimo-servlet_2.5_spec-1.2.jar"/>
<classpathentry kind="lib" path="lib/geronimo-stax-api_1.0_spec-1.0.1.jar"/>
<classpathentry kind="lib" path="lib/geronimo-ws-metadata_2.0_spec-1.1.2.jar"/>
<classpathentry kind="lib" path="lib/jaxb-api-2.1.jar"/>
<classpathentry kind="lib" path="lib/jaxb-impl-2.1.7.jar"/>
<classpathentry kind="lib" path="lib/jaxb-xjc-2.1.7.jar"/>
<classpathentry kind="lib" path="lib/jetty-6.1.9.jar"/>
<classpathentry kind="lib" path="lib/jetty-util-6.1.9.jar"/>
<classpathentry kind="lib" path="lib/neethi-2.0.4.jar"/>
<classpathentry kind="lib" path="lib/saaj-api-1.3.jar"/>
<classpathentry kind="lib" path="lib/saaj-impl-1.3.jar"/>
<classpathentry kind="lib" path="lib/spring-beans-2.0.8.jar"/>
<classpathentry kind="lib" path="lib/spring-context-2.0.8.jar"/>
<classpathentry kind="lib" path="lib/spring-core-2.0.8.jar"/>
<classpathentry kind="lib" path="lib/spring-web-2.0.8.jar"/>
<classpathentry kind="lib" path="lib/stax-utils-20060502.jar"/>
<classpathentry kind="lib" path="lib/velocity-1.4.jar"/>
<classpathentry kind="lib" path="lib/velocity-dep-1.4.jar"/>
<classpathentry kind="lib" path="lib/wsdl4j-1.6.2.jar"/>
<classpathentry kind="lib" path="lib/wss4j-1.5.4.jar"/>
<classpathentry kind="lib" path="lib/wstx-asl-3.2.4.jar"/>
<classpathentry kind="lib" path="lib/xml-resolver-1.2.jar"/>
<classpathentry kind="lib" path="lib/XmlSchema-1.4.2.jar"/>
<classpathentry kind="lib" path="lib/xmlsec-1.3.0.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/cmis-types.jar"/>
<classpathentry kind="output" path="build"/>
</classpath>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SimpleAlfrescoCmisServicesUsing</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<project name="SimpleAlfrescoCmisServicesUsing" default="build" basedir=".">
<property name="project.dir" value="." />
<property name="build.dir" value="${project.dir}/build" />
<property name="dist.dir" value="${build.dir}/dist" />
<path id="class.path">
<dirset dir="${build.dir}" />
<fileset dir="${project.dir}/lib" includes="**/*.jar" />
</path>
<target name="build">
<delete dir="${build.dir}" />
<mkdir dir="${build.dir}" />
<mkdir dir="${build.dir}/classes" />
<mkdir dir="${dist.dir}" />
<mkdir dir="${dist.dir}/lib" />
<javac classpathref="class.path" srcdir="${project.dir}/src" destdir="${build.dir}/classes" />
<jar destfile="${dist.dir}/cmis-test-client.jar">
<fileset dir="${build.dir}/classes" />
</jar>
<copy file="${project.dir}/cmis-test.bat" todir="${dist.dir}" />
<copy todir="${dist.dir}/lib">
<fileset dir="${project.dir}/lib" />
</copy>
<delete dir="${build.dir}/classes" />
</target>
</project>

View File

@@ -0,0 +1,6 @@
@echo off
set CLASSPATH=cmis-test.jar
for %%i in (./lib/*.jar) do call set CLASSPATH=./lib/%%~i;%%CLASSPATH%%
java org.alfresco.cmis.ws.example.SimpleExecutableCmisServicesUtilizer %1 %2 %3

View File

@@ -0,0 +1,6 @@
#!/bin/sh
export CLASSPATH=./cmis-test-client.jar
for jar in ./lib/*.jar; do export CLASSPATH=$CLASSPATH:$jar; done
java org.alfresco.cmis.ws.example.SimpleExecutableCmisServicesUtilizer $1 $2 $3

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,22 @@
This simple example connects to the Alfresco CMIS Server and displays the names
of the folders within the Alfresco root folder called "Company Home".
The example utilizes the Alfresco CMIS Web Services interfaces.
The example is stand-alone and includes all of its dependencies.
Steps to execute the example...
Pre-requisites:
a) The Alfresco Server must be running for the test client to succeed.
b) ant is required to build the test client
1) Unpack JavaCmisTest.zip to <destdir>
2) Run <destdir>/ant
3) Run <destdir>cmis-test.bat http://<alfresco_host>:<alfresco_port> <username> <password>
Note: A cmis-test.sh also exists.
Upon successful completion, a list of folder names is presented.
The source code for the example is also included.

View File

@@ -1,229 +1,229 @@
/*
* Copyright (C) 2005-2008 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.cmis.ws.example;
import java.io.IOException;
import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import org.alfresco.repo.cmis.ws.CmisObjectType;
import org.alfresco.repo.cmis.ws.CmisQueryType;
import org.alfresco.repo.cmis.ws.CmisRepositoryEntryType;
import org.alfresco.repo.cmis.ws.EnumTypesOfFileableObjects;
import org.alfresco.repo.cmis.ws.GetChildren;
import org.alfresco.repo.cmis.ws.GetChildrenResponse;
import org.alfresco.repo.cmis.ws.GetFolderParent;
import org.alfresco.repo.cmis.ws.GetRepositories;
import org.alfresco.repo.cmis.ws.GetRepositoryInfo;
import org.alfresco.repo.cmis.ws.GetTypes;
import org.alfresco.repo.cmis.ws.NavigationServicePort;
import org.alfresco.repo.cmis.ws.ObjectFactory;
import org.alfresco.repo.cmis.ws.RepositoryServicePort;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSPasswordCallback;
import org.apache.ws.security.handler.WSHandlerConstants;
/**
* This helper-class contain all necessary for <b>SimpleCmisWsTest</b> correct working service-methods
*
* @author Dmitry Velichkevich
*/
public class ExecutableServicesHelper
{
private static final QName NAVIGATION_SERVICE_NAME = new QName("http://www.cmis.org/ns/1.0", "NavigationService");
private static final QName REPOSITORY_SERVICE_NAME = new QName("http://www.cmis.org/ns/1.0", "RepositoryService");
private static final String NAVIGATION_SERVER_URL_POSTFIX = "/alfresco/cmis/NavigationService?wsdl";
private static final String REPOSITORY_SERVER_URL_POSTFIX = "/alfresco/cmis/RepositoryService?wsdl";
private static final Log LOGGER = LogFactory.getLog(ExecutableServicesHelper.class);
private String username;
private String password;
private Service navigationServicesFactory;
private Service repositoryServicesFactory;
/**
* @param username - an existent authentication user name
* @param password - appropriate password for specified user name
* @param serverAddress - IP address (or domain name) and port for the server to connect
* @throws Exception - an caught <b>MalformedURLException</b> in time of server connect <b>URL</b> creation
*/
public ExecutableServicesHelper(String username, String password, String serverAddress) throws Exception
{
this.username = username;
this.password = password;
try
{
navigationServicesFactory = Service.create(new URL(serverAddress + NAVIGATION_SERVER_URL_POSTFIX), NAVIGATION_SERVICE_NAME);
repositoryServicesFactory = Service.create(new URL(serverAddress + REPOSITORY_SERVER_URL_POSTFIX), REPOSITORY_SERVICE_NAME);
}
catch (MalformedURLException e)
{
throw new Exception("Field to connect to specified URL. Exception Message: " + e.getMessage());
}
}
/**
* This method simplify <b>RepositoryServicePort</b> instance creation
*
* @return an instance of <b>RepositoryServicePort</b>
*/
public RepositoryServicePort receiveAuthorizedRepositoryServicePort()
{
RepositoryServicePort result = repositoryServicesFactory.getPort(RepositoryServicePort.class);
createAuthorizationClient(result);
return result;
}
/**
* This method simplify <b>NavigationServicePort</b> instance creation
*
* @return an instance of <b>NavigationServicePort</b>
*/
public NavigationServicePort receiveAuthorizedNavigationServicePort()
{
NavigationServicePort result = navigationServicesFactory.getPort(NavigationServicePort.class);
createAuthorizationClient(result);
return result;
}
/**
* This method simplify configuring of <b>GetChildren CMIS Service</b> query with "ANY" filter, <b>Company Home Object Identificator</b> and <b>FOLDERS_AND_DOCUMENTS</b>
* entity types.
*
* @param servicesPort - <b>NavigationServicePort</b> configured with <b>WSS4J Client</b> instance
* @return <b>List< DocumentOrFolderObjectType></b> - list of all children elements of <b>Company Home</b> folder
* @throws Exception This exception throws when any <b>CMIS Services</b> operations was failed
*/
public List<CmisObjectType> receiveSpaceContent(NavigationServicePort servicesPort) throws Exception
{
GetChildrenResponse response;
response = servicesPort.getChildren(configureGetChildrenServiceQuery());
if ((response != null) && (response.getObject() != null))
{
return response.getObject();
}
else
{
return null;
}
}
/**
* This method simplify receiving of Object Identificator for Company Home Root Folder
*
* @param servicesPort - <b>RepositoryServicePort</b> instance that configured with WSS4J Client
* @return <b>String</b> representation of <b>Object Identificator</b>
* @throws Exception This exception throws when any <b>CMIS Services</b> operations was failed
*/
public String receiveCompanyHomeObjectId(RepositoryServicePort servicesPort) throws Exception
{
GetRepositoryInfo parameteers = new GetRepositoryInfo();
parameteers.setRepositoryId(servicesPort.getRepositories().get(0).getRepositoryID());
return servicesPort.getRepositoryInfo(parameteers).getRootFolderId();
}
/**
* This method simplify creation of authorized Client instance with specified user name and appropriate password
*
* @return - an instance of authorized <b>CMIS Client</b>
*/
protected Client createAuthorizationClient(Object servicePortInstance)
{
Map<String, Object> outInterceptorProperties = configureWss4jProperties();
WSS4JOutInterceptor outInterceptor = new WSS4JOutInterceptor(outInterceptorProperties);
return createAndConfigureClientInstance(servicePortInstance, outInterceptor);
}
private GetChildren configureGetChildrenServiceQuery() throws Exception
{
ObjectFactory objectFactory = new ObjectFactory();
RepositoryServicePort authorizedRepositoryServicePort = receiveAuthorizedRepositoryServicePort();
GetChildren requestParameters = objectFactory.createGetChildren();
requestParameters.setRepositoryId(authorizedRepositoryServicePort.getRepositories().get(0).getRepositoryID());
requestParameters.setFilter(objectFactory.createGetChildrenFilter("*"));
requestParameters.setMaxItems(objectFactory.createGetChildrenMaxItems(BigInteger.valueOf(Long.MAX_VALUE)));
requestParameters.setFolderId(receiveCompanyHomeObjectId(authorizedRepositoryServicePort));
requestParameters.setType(objectFactory.createGetChildrenType(EnumTypesOfFileableObjects.ANY));
return requestParameters;
}
private Client createAndConfigureClientInstance(Object servicePortInstance, WSS4JOutInterceptor outInterceptor)
{
Client client = ClientProxy.getClient(servicePortInstance);
client.getEndpoint().getOutInterceptors().add(new SAAJOutInterceptor());
client.getEndpoint().getOutInterceptors().add(outInterceptor);
return client;
}
private Map<String, Object> configureWss4jProperties()
{
Map<String, Object> outInterceptorProperties = new HashMap<String, Object>();
outInterceptorProperties.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN + " " + WSHandlerConstants.TIMESTAMP);
outInterceptorProperties.put(WSHandlerConstants.USER, username);
outInterceptorProperties.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_DIGEST);
outInterceptorProperties.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler()
{
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
{
((WSPasswordCallback) callbacks[0]).setPassword(password);
}
});
return outInterceptorProperties;
}
}
/*
* Copyright (C) 2005-2008 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.cmis.ws.example;
import java.io.IOException;
import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import org.alfresco.repo.cmis.ws.CmisObjectType;
import org.alfresco.repo.cmis.ws.CmisQueryType;
import org.alfresco.repo.cmis.ws.CmisRepositoryEntryType;
import org.alfresco.repo.cmis.ws.EnumTypesOfFileableObjects;
import org.alfresco.repo.cmis.ws.GetChildren;
import org.alfresco.repo.cmis.ws.GetChildrenResponse;
import org.alfresco.repo.cmis.ws.GetFolderParent;
import org.alfresco.repo.cmis.ws.GetRepositories;
import org.alfresco.repo.cmis.ws.GetRepositoryInfo;
import org.alfresco.repo.cmis.ws.GetTypes;
import org.alfresco.repo.cmis.ws.NavigationServicePort;
import org.alfresco.repo.cmis.ws.ObjectFactory;
import org.alfresco.repo.cmis.ws.RepositoryServicePort;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSPasswordCallback;
import org.apache.ws.security.handler.WSHandlerConstants;
/**
* This helper-class contain all necessary for <b>SimpleCmisWsTest</b> correct working service-methods
*
* @author Dmitry Velichkevich
*/
public class ExecutableServicesHelper
{
private static final QName NAVIGATION_SERVICE_NAME = new QName("http://www.cmis.org/ns/1.0", "NavigationService");
private static final QName REPOSITORY_SERVICE_NAME = new QName("http://www.cmis.org/ns/1.0", "RepositoryService");
private static final String NAVIGATION_SERVER_URL_POSTFIX = "/alfresco/cmis/NavigationService?wsdl";
private static final String REPOSITORY_SERVER_URL_POSTFIX = "/alfresco/cmis/RepositoryService?wsdl";
private static final Log LOGGER = LogFactory.getLog(ExecutableServicesHelper.class);
private String username;
private String password;
private Service navigationServicesFactory;
private Service repositoryServicesFactory;
/**
* @param username - an existent authentication user name
* @param password - appropriate password for specified user name
* @param serverAddress - IP address (or domain name) and port for the server to connect
* @throws Exception - an caught <b>MalformedURLException</b> in time of server connect <b>URL</b> creation
*/
public ExecutableServicesHelper(String username, String password, String serverAddress) throws Exception
{
this.username = username;
this.password = password;
try
{
navigationServicesFactory = Service.create(new URL(serverAddress + NAVIGATION_SERVER_URL_POSTFIX), NAVIGATION_SERVICE_NAME);
repositoryServicesFactory = Service.create(new URL(serverAddress + REPOSITORY_SERVER_URL_POSTFIX), REPOSITORY_SERVICE_NAME);
}
catch (MalformedURLException e)
{
throw new Exception("Field to connect to specified URL. Exception Message: " + e.getMessage());
}
}
/**
* This method simplify <b>RepositoryServicePort</b> instance creation
*
* @return an instance of <b>RepositoryServicePort</b>
*/
public RepositoryServicePort receiveAuthorizedRepositoryServicePort()
{
RepositoryServicePort result = repositoryServicesFactory.getPort(RepositoryServicePort.class);
createAuthorizationClient(result);
return result;
}
/**
* This method simplify <b>NavigationServicePort</b> instance creation
*
* @return an instance of <b>NavigationServicePort</b>
*/
public NavigationServicePort receiveAuthorizedNavigationServicePort()
{
NavigationServicePort result = navigationServicesFactory.getPort(NavigationServicePort.class);
createAuthorizationClient(result);
return result;
}
/**
* This method simplify configuring of <b>GetChildren CMIS Service</b> query with "ANY" filter, <b>Company Home Object Identificator</b> and <b>FOLDERS_AND_DOCUMENTS</b>
* entity types.
*
* @param servicesPort - <b>NavigationServicePort</b> configured with <b>WSS4J Client</b> instance
* @return <b>List< DocumentOrFolderObjectType></b> - list of all children elements of <b>Company Home</b> folder
* @throws Exception This exception throws when any <b>CMIS Services</b> operations was failed
*/
public List<CmisObjectType> receiveSpaceContent(NavigationServicePort servicesPort) throws Exception
{
GetChildrenResponse response;
response = servicesPort.getChildren(configureGetChildrenServiceQuery());
if ((response != null) && (response.getObject() != null))
{
return response.getObject();
}
else
{
return null;
}
}
/**
* This method simplify receiving of Object Identificator for Company Home Root Folder
*
* @param servicesPort - <b>RepositoryServicePort</b> instance that configured with WSS4J Client
* @return <b>String</b> representation of <b>Object Identificator</b>
* @throws Exception This exception throws when any <b>CMIS Services</b> operations was failed
*/
public String receiveCompanyHomeObjectId(RepositoryServicePort servicesPort) throws Exception
{
GetRepositoryInfo parameteers = new GetRepositoryInfo();
parameteers.setRepositoryId(servicesPort.getRepositories().get(0).getRepositoryID());
return servicesPort.getRepositoryInfo(parameteers).getRootFolderId();
}
/**
* This method simplify creation of authorized Client instance with specified user name and appropriate password
*
* @return - an instance of authorized <b>CMIS Client</b>
*/
protected Client createAuthorizationClient(Object servicePortInstance)
{
Map<String, Object> outInterceptorProperties = configureWss4jProperties();
WSS4JOutInterceptor outInterceptor = new WSS4JOutInterceptor(outInterceptorProperties);
return createAndConfigureClientInstance(servicePortInstance, outInterceptor);
}
private GetChildren configureGetChildrenServiceQuery() throws Exception
{
ObjectFactory objectFactory = new ObjectFactory();
RepositoryServicePort authorizedRepositoryServicePort = receiveAuthorizedRepositoryServicePort();
GetChildren requestParameters = objectFactory.createGetChildren();
requestParameters.setRepositoryId(authorizedRepositoryServicePort.getRepositories().get(0).getRepositoryID());
requestParameters.setFilter(objectFactory.createGetChildrenFilter("*"));
requestParameters.setMaxItems(objectFactory.createGetChildrenMaxItems(BigInteger.valueOf(Long.MAX_VALUE)));
requestParameters.setFolderId(receiveCompanyHomeObjectId(authorizedRepositoryServicePort));
requestParameters.setType(objectFactory.createGetChildrenType(EnumTypesOfFileableObjects.ANY));
return requestParameters;
}
private Client createAndConfigureClientInstance(Object servicePortInstance, WSS4JOutInterceptor outInterceptor)
{
Client client = ClientProxy.getClient(servicePortInstance);
client.getEndpoint().getOutInterceptors().add(new SAAJOutInterceptor());
client.getEndpoint().getOutInterceptors().add(outInterceptor);
return client;
}
private Map<String, Object> configureWss4jProperties()
{
Map<String, Object> outInterceptorProperties = new HashMap<String, Object>();
outInterceptorProperties.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN + " " + WSHandlerConstants.TIMESTAMP);
outInterceptorProperties.put(WSHandlerConstants.USER, username);
outInterceptorProperties.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_DIGEST);
outInterceptorProperties.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler()
{
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
{
((WSPasswordCallback) callbacks[0]).setPassword(password);
}
});
return outInterceptorProperties;
}
}

View File

@@ -1,123 +1,123 @@
/*
* Copyright (C) 2005-2008 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.cmis.ws.example;
import java.util.List;
import org.alfresco.repo.cmis.ws.CmisObjectType;
import org.alfresco.repo.cmis.ws.CmisPropertiesType;
import org.alfresco.repo.cmis.ws.CmisProperty;
import org.alfresco.repo.cmis.ws.CmisPropertyString;
/**
* This class executes simple processing for prompting server address and user name and password for authentication this user on specified server. After successful connection this
* class print contents of Company Home.<br />
* <br />
* This class expects next command-line parameters:<nobr />
* <ul>
* <li><b>Server Address</b> - with form: (IP_ADDRESS|DOMAIN_NAME):PORT;</li>
* <li><b>Username</b> - login name of the existent user;</li>
* <li><b>Password</b> - appropriate password for specified user.</li>
* </ul>
* <b>Example: <font color=green>192.168.0.1:8080 admin admin</font></b> - authenticate an user as admin on <font color=gray><b>http://192.168.0.1:8080/alfresco/</b></font>
* server
*
* @author Dmitry Velichkevich
*/
public class SimpleExecutableCmisServicesUtilizer
{
/**
* Executable entry point - represents main life cycle
*
* @param args - not used
* @see SimpleCmisWsTest description
*/
public static void main(String[] args)
{
String username = null;
String password = null;
String serverUrl = null;
if (args.length != 3)
{
System.out.println("Usage: cmis-test.bat server_url username password");
System.out.println("Example : cmis-test.bat http://localhost:8080 admin admin");
return;
}
else
{
serverUrl = args[0];
username = args[1];
password = args[2];
}
ExecutableServicesHelper servicesHelper;
try
{
servicesHelper = new ExecutableServicesHelper(username, password, serverUrl);
}
catch (Exception e)
{
System.out.println("Can't connect to specified server. Message: " + e.getMessage());
return;
}
List<CmisObjectType> response;
try
{
response = servicesHelper.receiveSpaceContent(servicesHelper.receiveAuthorizedNavigationServicePort());
}
catch (Exception e)
{
System.out.println("Can't receive content of Company Home caused: " + e.getMessage());
e.printStackTrace();
return;
}
System.out.println("Outing Company Home contents:");
for (CmisObjectType item : response)
{
boolean thisIsFolder = ((CmisPropertyString) getCmisProperty(item.getProperties(), "BaseType")).getValue().contains("folder");
String itemName = ((CmisPropertyString) getCmisProperty(item.getProperties(), "Name")).getValue();
System.out.println(((thisIsFolder) ? ("[") : ("")) + itemName + ((thisIsFolder) ? ("]") : ("")));
}
}
private static CmisProperty getCmisProperty(CmisPropertiesType properties, String cmisPropertyName)
{
for (CmisProperty cmisProperty : properties.getProperty())
{
if (cmisProperty.getName().equalsIgnoreCase(cmisPropertyName))
{
return cmisProperty;
}
}
return null;
}
}
/*
* Copyright (C) 2005-2008 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.cmis.ws.example;
import java.util.List;
import org.alfresco.repo.cmis.ws.CmisObjectType;
import org.alfresco.repo.cmis.ws.CmisPropertiesType;
import org.alfresco.repo.cmis.ws.CmisProperty;
import org.alfresco.repo.cmis.ws.CmisPropertyString;
/**
* This class executes simple processing for prompting server address and user name and password for authentication this user on specified server. After successful connection this
* class print contents of Company Home.<br />
* <br />
* This class expects next command-line parameters:<nobr />
* <ul>
* <li><b>Server Address</b> - with form: (IP_ADDRESS|DOMAIN_NAME):PORT;</li>
* <li><b>Username</b> - login name of the existent user;</li>
* <li><b>Password</b> - appropriate password for specified user.</li>
* </ul>
* <b>Example: <font color=green>192.168.0.1:8080 admin admin</font></b> - authenticate an user as admin on <font color=gray><b>http://192.168.0.1:8080/alfresco/</b></font>
* server
*
* @author Dmitry Velichkevich
*/
public class SimpleExecutableCmisServicesUtilizer
{
/**
* Executable entry point - represents main life cycle
*
* @param args - not used
* @see SimpleCmisWsTest description
*/
public static void main(String[] args)
{
String username = null;
String password = null;
String serverUrl = null;
if (args.length != 3)
{
System.out.println("Usage: cmis-test.bat server_url username password");
System.out.println("Example : cmis-test.bat http://localhost:8080 admin admin");
return;
}
else
{
serverUrl = args[0];
username = args[1];
password = args[2];
}
ExecutableServicesHelper servicesHelper;
try
{
servicesHelper = new ExecutableServicesHelper(username, password, serverUrl);
}
catch (Exception e)
{
System.out.println("Can't connect to specified server. Message: " + e.getMessage());
return;
}
List<CmisObjectType> response;
try
{
response = servicesHelper.receiveSpaceContent(servicesHelper.receiveAuthorizedNavigationServicePort());
}
catch (Exception e)
{
System.out.println("Can't receive content of Company Home caused: " + e.getMessage());
e.printStackTrace();
return;
}
System.out.println("Outing Company Home contents:");
for (CmisObjectType item : response)
{
boolean thisIsFolder = ((CmisPropertyString) getCmisProperty(item.getProperties(), "BaseType")).getValue().contains("folder");
String itemName = ((CmisPropertyString) getCmisProperty(item.getProperties(), "Name")).getValue();
System.out.println(((thisIsFolder) ? ("[") : ("")) + itemName + ((thisIsFolder) ? ("]") : ("")));
}
}
private static CmisProperty getCmisProperty(CmisPropertiesType properties, String cmisPropertyName)
{
for (CmisProperty cmisProperty : properties.getProperty())
{
if (cmisProperty.getName().equalsIgnoreCase(cmisPropertyName))
{
return cmisProperty;
}
}
return null;
}
}

Binary file not shown.

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="RepositoryServiceSoapBinding" messageEncoding="Text">
<security mode="TransportWithMessageCredential">
<transport />
<message clientCredentialType="UserName" />
</security>
</binding>
<binding name="NavigationServiceSoapBinding" messageEncoding="Text">
<security mode="TransportWithMessageCredential">
<transport />
<message clientCredentialType="UserName" />
</security>
</binding>
<binding name="ObjectServiceSoapBinding" messageEncoding="Mtom">
<security mode="TransportWithMessageCredential">
<transport />
<message clientCredentialType="UserName" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://localhost:8443/alfresco/cmis/RepositoryService"
binding="basicHttpBinding" bindingConfiguration="RepositoryServiceSoapBinding"
contract="RepositoryServicePort" name="RepositoryServicePort" />
<endpoint address="https://localhost:8443/alfresco/cmis/NavigationService"
binding="basicHttpBinding" bindingConfiguration="NavigationServiceSoapBinding"
contract="NavigationServicePort" name="NavigationServicePort" />
<endpoint address="https://localhost:8443/alfresco/cmis/ObjectService"
binding="basicHttpBinding" bindingConfiguration="ObjectServiceSoapBinding"
contract="ObjectServicePort" name="ObjectServicePort" />
</client>
</system.serviceModel>
</configuration>

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{AA3B7140-D34D-430B-BAF8-29E8220263CA}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CmisTest</RootNamespace>
<AssemblyName>CmisTest</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Runtime.Serialization">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.ServiceModel">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web.Services" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="NavigationService.cs" />
<Compile Include="ObjectService.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RepositoryService.cs" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,581 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: System.Runtime.Serialization.ContractNamespaceAttribute("http://www.cmis.org/ns/1.0", ClrNamespace="www.cmis.org.ns._1._01")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="http://www.cmis.org/ns/1.0", ConfigurationName="NavigationServicePort")]
public interface NavigationServicePort
{
// CODEGEN: Parameter 'documentAndFolderCollection' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'System.Xml.Serialization.XmlArrayItemAttribute'.
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FilterNotValidException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FolderNotValidException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(repositoryInfoType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeDefinitionType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeBase))]
[return: System.ServiceModel.MessageParameterAttribute(Name="documentAndFolderCollection")]
getDescendantsResponse getDescendants(getDescendants request);
// CODEGEN: Parameter 'documentCollection' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'System.Xml.Serialization.XmlArrayItemAttribute'.
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FilterNotValidException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FolderNotValidException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(repositoryInfoType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeDefinitionType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeBase))]
[return: System.ServiceModel.MessageParameterAttribute(Name="documentCollection")]
getCheckedoutDocsResponse getCheckedoutDocs(getCheckedoutDocs request);
// CODEGEN: Parameter 'folderCollection' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'System.Xml.Serialization.XmlArrayItemAttribute'.
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FilterNotValidException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ObjectNotFoundException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(repositoryInfoType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeDefinitionType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeBase))]
[return: System.ServiceModel.MessageParameterAttribute(Name="folderCollection")]
getDocumentParentsResponse getDocumentParents(getDocumentParents request);
// CODEGEN: Parameter 'documentAndFolderCollection' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'System.Xml.Serialization.XmlArrayItemAttribute'.
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FilterNotValidException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FolderNotValidException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(repositoryInfoType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeDefinitionType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeBase))]
[return: System.ServiceModel.MessageParameterAttribute(Name="documentAndFolderCollection")]
getChildrenResponse getChildren(getChildren request);
// CODEGEN: Parameter 'folderCollection' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'System.Xml.Serialization.XmlArrayItemAttribute'.
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FilterNotValidException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FolderNotValidException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(repositoryInfoType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeDefinitionType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeBase))]
[return: System.ServiceModel.MessageParameterAttribute(Name="folderCollection")]
getFolderParentResponse getFolderParent(getFolderParent request);
// CODEGEN: Parameter 'documentCollection' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'System.Xml.Serialization.XmlArrayItemAttribute'.
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FilterNotValidException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(repositoryInfoType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeDefinitionType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeBase))]
[return: System.ServiceModel.MessageParameterAttribute(Name="documentCollection")]
getUnfiledDocsResponse getUnfiledDocs(getUnfiledDocs request);
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "3.0.4506.648")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.cmis.org/ns/1.0")]
public enum typesOfObjectsEnum
{
/// <remarks/>
FoldersAndDocumets,
/// <remarks/>
Folders,
/// <remarks/>
Documents,
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getDescendants", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getDescendants
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
public string folderId;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=1)]
public typesOfObjectsEnum type;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=2)]
public object depth;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=3)]
public string filter;
public getDescendants()
{
}
public getDescendants(string folderId, typesOfObjectsEnum type, object depth, string filter)
{
this.folderId = folderId;
this.type = type;
this.depth = depth;
this.filter = filter;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getDescendantsResponse", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getDescendantsResponse
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
[System.Xml.Serialization.XmlArrayItemAttribute("object", IsNullable=false)]
public documentOrFolderObjectType[] documentAndFolderCollection;
public getDescendantsResponse()
{
}
public getDescendantsResponse(documentOrFolderObjectType[] documentAndFolderCollection)
{
this.documentAndFolderCollection = documentAndFolderCollection;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getCheckedoutDocs", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getCheckedoutDocs
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
public string filter;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=1)]
[System.Xml.Serialization.XmlElementAttribute(DataType="integer")]
public string maxItems;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=2)]
[System.Xml.Serialization.XmlElementAttribute(DataType="integer")]
public string skipCount;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=3)]
public string folderID;
public getCheckedoutDocs()
{
}
public getCheckedoutDocs(string filter, string maxItems, string skipCount, string folderID)
{
this.filter = filter;
this.maxItems = maxItems;
this.skipCount = skipCount;
this.folderID = folderID;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getCheckedoutDocsResponse", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getCheckedoutDocsResponse
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
[System.Xml.Serialization.XmlArrayItemAttribute("object", IsNullable=false)]
public documentObjectType[] documentCollection;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=1)]
public bool hasMoreItems;
public getCheckedoutDocsResponse()
{
}
public getCheckedoutDocsResponse(documentObjectType[] documentCollection, bool hasMoreItems)
{
this.documentCollection = documentCollection;
this.hasMoreItems = hasMoreItems;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getDocumentParents", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getDocumentParents
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
public string documentId;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=1)]
public string filter;
public getDocumentParents()
{
}
public getDocumentParents(string documentId, string filter)
{
this.documentId = documentId;
this.filter = filter;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getDocumentParentsResponse", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getDocumentParentsResponse
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
[System.Xml.Serialization.XmlArrayItemAttribute("object", IsNullable=false)]
public folderObjectType[] folderCollection;
public getDocumentParentsResponse()
{
}
public getDocumentParentsResponse(folderObjectType[] folderCollection)
{
this.folderCollection = folderCollection;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getChildren", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getChildren
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
public string folderId;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=1)]
public typesOfObjectsEnum type;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=2)]
public string filter;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=3)]
[System.Xml.Serialization.XmlElementAttribute(DataType="integer")]
public string maxItems;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=4)]
[System.Xml.Serialization.XmlElementAttribute(DataType="integer")]
public string skipCount;
public getChildren()
{
}
public getChildren(string folderId, typesOfObjectsEnum type, string filter, string maxItems, string skipCount)
{
this.folderId = folderId;
this.type = type;
this.filter = filter;
this.maxItems = maxItems;
this.skipCount = skipCount;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getChildrenResponse", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getChildrenResponse
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
[System.Xml.Serialization.XmlArrayItemAttribute("object", IsNullable=false)]
public documentOrFolderObjectType[] documentAndFolderCollection;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=1)]
public bool hasMoreItems;
public getChildrenResponse()
{
}
public getChildrenResponse(documentOrFolderObjectType[] documentAndFolderCollection, bool hasMoreItems)
{
this.documentAndFolderCollection = documentAndFolderCollection;
this.hasMoreItems = hasMoreItems;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getFolderParent", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getFolderParent
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
public string folderId;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=1)]
public string filter;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=2)]
public bool returnToRoot;
public getFolderParent()
{
}
public getFolderParent(string folderId, string filter, bool returnToRoot)
{
this.folderId = folderId;
this.filter = filter;
this.returnToRoot = returnToRoot;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getFolderParentResponse", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getFolderParentResponse
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
[System.Xml.Serialization.XmlArrayItemAttribute("object", IsNullable=false)]
public folderObjectType[] folderCollection;
public getFolderParentResponse()
{
}
public getFolderParentResponse(folderObjectType[] folderCollection)
{
this.folderCollection = folderCollection;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getUnfiledDocs", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getUnfiledDocs
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
public string filter;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=1)]
[System.Xml.Serialization.XmlElementAttribute(DataType="integer")]
public string maxDocuments;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=2)]
[System.Xml.Serialization.XmlElementAttribute(DataType="integer")]
public string skipCount;
public getUnfiledDocs()
{
}
public getUnfiledDocs(string filter, string maxDocuments, string skipCount)
{
this.filter = filter;
this.maxDocuments = maxDocuments;
this.skipCount = skipCount;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getUnfiledDocsResponse", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getUnfiledDocsResponse
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
[System.Xml.Serialization.XmlArrayItemAttribute("object", IsNullable=false)]
public documentObjectType[] documentCollection;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=1)]
public bool hasMoreItems;
public getUnfiledDocsResponse()
{
}
public getUnfiledDocsResponse(documentObjectType[] documentCollection, bool hasMoreItems)
{
this.documentCollection = documentCollection;
this.hasMoreItems = hasMoreItems;
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public interface NavigationServicePortChannel : NavigationServicePort, System.ServiceModel.IClientChannel
{
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class NavigationServicePortClient : System.ServiceModel.ClientBase<NavigationServicePort>, NavigationServicePort
{
public NavigationServicePortClient()
{
}
public NavigationServicePortClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
public NavigationServicePortClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
public NavigationServicePortClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
public NavigationServicePortClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
getDescendantsResponse NavigationServicePort.getDescendants(getDescendants request)
{
return base.Channel.getDescendants(request);
}
public documentOrFolderObjectType[] getDescendants(string folderId, typesOfObjectsEnum type, object depth, string filter)
{
getDescendants inValue = new getDescendants();
inValue.folderId = folderId;
inValue.type = type;
inValue.depth = depth;
inValue.filter = filter;
getDescendantsResponse retVal = ((NavigationServicePort)(this)).getDescendants(inValue);
return retVal.documentAndFolderCollection;
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
getCheckedoutDocsResponse NavigationServicePort.getCheckedoutDocs(getCheckedoutDocs request)
{
return base.Channel.getCheckedoutDocs(request);
}
public documentObjectType[] getCheckedoutDocs(string filter, string maxItems, string skipCount, string folderID, out bool hasMoreItems)
{
getCheckedoutDocs inValue = new getCheckedoutDocs();
inValue.filter = filter;
inValue.maxItems = maxItems;
inValue.skipCount = skipCount;
inValue.folderID = folderID;
getCheckedoutDocsResponse retVal = ((NavigationServicePort)(this)).getCheckedoutDocs(inValue);
hasMoreItems = retVal.hasMoreItems;
return retVal.documentCollection;
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
getDocumentParentsResponse NavigationServicePort.getDocumentParents(getDocumentParents request)
{
return base.Channel.getDocumentParents(request);
}
public folderObjectType[] getDocumentParents(string documentId, string filter)
{
getDocumentParents inValue = new getDocumentParents();
inValue.documentId = documentId;
inValue.filter = filter;
getDocumentParentsResponse retVal = ((NavigationServicePort)(this)).getDocumentParents(inValue);
return retVal.folderCollection;
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
getChildrenResponse NavigationServicePort.getChildren(getChildren request)
{
return base.Channel.getChildren(request);
}
public documentOrFolderObjectType[] getChildren(string folderId, typesOfObjectsEnum type, string filter, string maxItems, string skipCount, out bool hasMoreItems)
{
getChildren inValue = new getChildren();
inValue.folderId = folderId;
inValue.type = type;
inValue.filter = filter;
inValue.maxItems = maxItems;
inValue.skipCount = skipCount;
getChildrenResponse retVal = ((NavigationServicePort)(this)).getChildren(inValue);
hasMoreItems = retVal.hasMoreItems;
return retVal.documentAndFolderCollection;
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
getFolderParentResponse NavigationServicePort.getFolderParent(getFolderParent request)
{
return base.Channel.getFolderParent(request);
}
public folderObjectType[] getFolderParent(string folderId, string filter, bool returnToRoot)
{
getFolderParent inValue = new getFolderParent();
inValue.folderId = folderId;
inValue.filter = filter;
inValue.returnToRoot = returnToRoot;
getFolderParentResponse retVal = ((NavigationServicePort)(this)).getFolderParent(inValue);
return retVal.folderCollection;
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
getUnfiledDocsResponse NavigationServicePort.getUnfiledDocs(getUnfiledDocs request)
{
return base.Channel.getUnfiledDocs(request);
}
public documentObjectType[] getUnfiledDocs(string filter, string maxDocuments, string skipCount, out bool hasMoreItems)
{
getUnfiledDocs inValue = new getUnfiledDocs();
inValue.filter = filter;
inValue.maxDocuments = maxDocuments;
inValue.skipCount = skipCount;
getUnfiledDocsResponse retVal = ((NavigationServicePort)(this)).getUnfiledDocs(inValue);
hasMoreItems = retVal.hasMoreItems;
return retVal.documentCollection;
}
}

View File

@@ -0,0 +1,643 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: System.Runtime.Serialization.ContractNamespaceAttribute("http://www.cmis.org/ns/1.0", ClrNamespace="www.cmis.org.ns._1._01")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="http://www.cmis.org/ns/1.0", ConfigurationName="ObjectServicePort")]
public interface ObjectServicePort
{
// CODEGEN: Parameter 'failedToDelete' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'System.Xml.Serialization.XmlArrayItemAttribute'.
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FolderNotValidException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[return: System.ServiceModel.MessageParameterAttribute(Name="failedToDelete")]
deleteTreeResponse deleteTree(deleteTree request);
// CODEGEN: Parameter 'allowableActionCollection' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'System.Xml.Serialization.XmlArrayItemAttribute'.
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ObjectNotFoundException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[return: System.ServiceModel.MessageParameterAttribute(Name="allowableActionCollection")]
getAllowableActionsResponse getAllowableActions(getAllowableActions request);
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConstraintViolationException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ObjectNotFoundException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="NotInFolderException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FolderNotValidException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
void moveObject(string objectId, string folderId, string sourceFolderId);
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="StorageException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConstraintViolationException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="StreamNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ObjectNotFoundException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
void deleteContentStream(string documentId);
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConstraintViolationException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="TypeNotFoundException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FolderNotValidException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeBase))]
[return: System.ServiceModel.MessageParameterAttribute(Name="objectId")]
string createFolder(string typeId, folderObjectType propertyCollection, string folderId);
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ObjectNotFoundException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeBase))]
void updateProperties(string objectId, string changeToken, documentFolderOrRelationshipObjectType @object);
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="StorageException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConstraintViolationException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="StreamNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="TypeNotFoundException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FolderNotValidException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeBase))]
[return: System.ServiceModel.MessageParameterAttribute(Name="objectId")]
string createDocument(string typeId, documentObjectType propertyCollection, string folderId, contentStream contentStream, versioningStateEnum versioningState);
// CODEGEN: Parameter 'stream' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'System.Xml.Serialization.XmlElementAttribute'.
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="StorageException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="StreamNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ObjectNotFoundException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OffsetException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeBase))]
[return: System.ServiceModel.MessageParameterAttribute(Name="stream")]
getContentStreamResponse getContentStream(getContentStream request);
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConstraintViolationException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ObjectNotFoundException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="TypeNotFoundException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeBase))]
[return: System.ServiceModel.MessageParameterAttribute(Name="objectId")]
string createRelationship(string typeId, relationshipObjectType propertyCollection, string sourceObjectId, string targetObjectId);
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="StorageException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConstraintViolationException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="StreamNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ObjectNotFoundException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="AlreadyExistsException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeBase))]
void setContentStream(string documentId, bool overwriteFlag, contentStream contentStream);
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConstraintViolationException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ObjectNotFoundException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeBase))]
void deleteObject(string objectId);
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="InvalidArgumentException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="FilterNotValidException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="RuntimeException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ObjectNotFoundException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="PermissionDeniedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="OperationNotSupportedException")]
[System.ServiceModel.FaultContractAttribute(typeof(object), Action="", Name="ConcurrencyException")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(objectTypeBase))]
[return: System.ServiceModel.MessageParameterAttribute(Name="object")]
documentFolderOrRelationshipObjectType getProperties(string objectId, versionEnum returnVersion, string filter);
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "3.0.4506.648")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.cmis.org/ns/1.0")]
public enum deleteWithMultiFilingEnum
{
/// <remarks/>
unfile,
/// <remarks/>
deleteSingleFiledDocs,
/// <remarks/>
delete,
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="deleteTree", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class deleteTree
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
public string folderId;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=1)]
public deleteWithMultiFilingEnum unfileMultiFiledDocuments;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=2)]
public bool continueOnFailure;
public deleteTree()
{
}
public deleteTree(string folderId, deleteWithMultiFilingEnum unfileMultiFiledDocuments, bool continueOnFailure)
{
this.folderId = folderId;
this.unfileMultiFiledDocuments = unfileMultiFiledDocuments;
this.continueOnFailure = continueOnFailure;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="deleteTreeResponse", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class deleteTreeResponse
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
[System.Xml.Serialization.XmlArrayItemAttribute("objectId", IsNullable=false)]
public string[] failedToDelete;
public deleteTreeResponse()
{
}
public deleteTreeResponse(string[] failedToDelete)
{
this.failedToDelete = failedToDelete;
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "3.0.4506.648")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.cmis.org/ns/1.0")]
public enum allowableActionsEnum
{
/// <remarks/>
viewContent,
/// <remarks/>
updateProperties,
/// <remarks/>
setContent,
/// <remarks/>
removeFromFolder,
/// <remarks/>
move,
/// <remarks/>
getRelationships,
/// <remarks/>
getProperties,
/// <remarks/>
getParents,
/// <remarks/>
getChilderen,
/// <remarks/>
getAllVersions,
/// <remarks/>
deleteVersion,
/// <remarks/>
deleteContent,
/// <remarks/>
delete,
/// <remarks/>
checkOut,
/// <remarks/>
checkIn,
/// <remarks/>
cancelCheckOut,
/// <remarks/>
addToFolder,
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getAllowableActions", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getAllowableActions
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
public string objectId;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=1)]
public string asUser;
public getAllowableActions()
{
}
public getAllowableActions(string objectId, string asUser)
{
this.objectId = objectId;
this.asUser = asUser;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getAllowableActionsResponse", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getAllowableActionsResponse
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
[System.Xml.Serialization.XmlArrayItemAttribute("action", IsNullable=false)]
public allowableActionsEnum[] allowableActionCollection;
public getAllowableActionsResponse()
{
}
public getAllowableActionsResponse(allowableActionsEnum[] allowableActionCollection)
{
this.allowableActionCollection = allowableActionCollection;
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "3.0.4506.648")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.cmis.org/ns/1.0")]
public partial class contentStream
{
private string mimeTypeField;
private string nameField;
private string uriField;
private byte[] streamField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=0)]
public string mimeType
{
get
{
return this.mimeTypeField;
}
set
{
this.mimeTypeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=1)]
public string name
{
get
{
return this.nameField;
}
set
{
this.nameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=2)]
public string uri
{
get
{
return this.uriField;
}
set
{
this.uriField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary", Order=3)]
public byte[] stream
{
get
{
return this.streamField;
}
set
{
this.streamField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "3.0.4506.648")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.cmis.org/ns/1.0")]
public enum versioningStateEnum
{
/// <remarks/>
checkedOut,
/// <remarks/>
checkedInMinor,
/// <remarks/>
checkedInMajor,
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getContentStream", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getContentStream
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
public string documentId;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=1)]
[System.Xml.Serialization.XmlElementAttribute(DataType="integer")]
public string offset;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=2)]
[System.Xml.Serialization.XmlElementAttribute(DataType="integer")]
public string length;
public getContentStream()
{
}
public getContentStream(string documentId, string offset, string length)
{
this.documentId = documentId;
this.offset = offset;
this.length = length;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="getContentStreamResponse", WrapperNamespace="http://www.cmis.org/ns/1.0", IsWrapped=true)]
public partial class getContentStreamResponse
{
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.cmis.org/ns/1.0", Order=0)]
[System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")]
public byte[] stream;
public getContentStreamResponse()
{
}
public getContentStreamResponse(byte[] stream)
{
this.stream = stream;
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "3.0.4506.648")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.cmis.org/ns/1.0")]
public enum versionEnum
{
/// <remarks/>
@this,
/// <remarks/>
latestMajor,
/// <remarks/>
latest,
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public interface ObjectServicePortChannel : ObjectServicePort, System.ServiceModel.IClientChannel
{
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class ObjectServicePortClient : System.ServiceModel.ClientBase<ObjectServicePort>, ObjectServicePort
{
public ObjectServicePortClient()
{
}
public ObjectServicePortClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
public ObjectServicePortClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
public ObjectServicePortClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
public ObjectServicePortClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
deleteTreeResponse ObjectServicePort.deleteTree(deleteTree request)
{
return base.Channel.deleteTree(request);
}
public string[] deleteTree(string folderId, deleteWithMultiFilingEnum unfileMultiFiledDocuments, bool continueOnFailure)
{
deleteTree inValue = new deleteTree();
inValue.folderId = folderId;
inValue.unfileMultiFiledDocuments = unfileMultiFiledDocuments;
inValue.continueOnFailure = continueOnFailure;
deleteTreeResponse retVal = ((ObjectServicePort)(this)).deleteTree(inValue);
return retVal.failedToDelete;
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
getAllowableActionsResponse ObjectServicePort.getAllowableActions(getAllowableActions request)
{
return base.Channel.getAllowableActions(request);
}
public allowableActionsEnum[] getAllowableActions(string objectId, string asUser)
{
getAllowableActions inValue = new getAllowableActions();
inValue.objectId = objectId;
inValue.asUser = asUser;
getAllowableActionsResponse retVal = ((ObjectServicePort)(this)).getAllowableActions(inValue);
return retVal.allowableActionCollection;
}
public void moveObject(string objectId, string folderId, string sourceFolderId)
{
base.Channel.moveObject(objectId, folderId, sourceFolderId);
}
public void deleteContentStream(string documentId)
{
base.Channel.deleteContentStream(documentId);
}
public string createFolder(string typeId, folderObjectType propertyCollection, string folderId)
{
return base.Channel.createFolder(typeId, propertyCollection, folderId);
}
public void updateProperties(string objectId, string changeToken, documentFolderOrRelationshipObjectType @object)
{
base.Channel.updateProperties(objectId, changeToken, @object);
}
public string createDocument(string typeId, documentObjectType propertyCollection, string folderId, contentStream contentStream, versioningStateEnum versioningState)
{
return base.Channel.createDocument(typeId, propertyCollection, folderId, contentStream, versioningState);
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
getContentStreamResponse ObjectServicePort.getContentStream(getContentStream request)
{
return base.Channel.getContentStream(request);
}
public byte[] getContentStream(string documentId, string offset, string length)
{
getContentStream inValue = new getContentStream();
inValue.documentId = documentId;
inValue.offset = offset;
inValue.length = length;
getContentStreamResponse retVal = ((ObjectServicePort)(this)).getContentStream(inValue);
return retVal.stream;
}
public string createRelationship(string typeId, relationshipObjectType propertyCollection, string sourceObjectId, string targetObjectId)
{
return base.Channel.createRelationship(typeId, propertyCollection, sourceObjectId, targetObjectId);
}
public void setContentStream(string documentId, bool overwriteFlag, contentStream contentStream)
{
base.Channel.setContentStream(documentId, overwriteFlag, contentStream);
}
public void deleteObject(string objectId)
{
base.Channel.deleteObject(objectId);
}
public documentFolderOrRelationshipObjectType getProperties(string objectId, versionEnum returnVersion, string filter)
{
return base.Channel.getProperties(objectId, returnVersion, filter);
}
}
namespace www.cmis.org.ns._1._01
{
using System.Runtime.Serialization;
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
[System.Runtime.Serialization.CollectionDataContractAttribute(Name="failedToDelete", Namespace="http://www.cmis.org/ns/1.0", ItemName="objectId")]
public class failedToDelete : System.Collections.Generic.List<string>
{
}
}

View File

@@ -0,0 +1,118 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Net;
using System.ServiceModel;
using System.ServiceModel.Security;
using System.ServiceModel.Security.Tokens;
using System.Security.Cryptography.X509Certificates;
using System.Net.Security;
using System.ServiceModel.Channels;
using www.cmis.org.ns._1._01;
namespace CmisTest
{
class Program
{
static void Main(string[] args)
{
ServicePointManager.ServerCertificateValidationCallback = delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
};
RepositoryServicePortClient repositoryService = new RepositoryServicePortClient();
repositoryService.ClientCredentials.UserName.UserName = "admin";
repositoryService.ClientCredentials.UserName.Password = "admin";
NavigationServicePortClient navigationService = new NavigationServicePortClient();
navigationService.ClientCredentials.UserName.UserName = "admin";
navigationService.ClientCredentials.UserName.Password = "admin";
ObjectServicePortClient objectService = new ObjectServicePortClient();
objectService.ClientCredentials.UserName.UserName = "admin";
objectService.ClientCredentials.UserName.Password = "admin";
folderObjectType rootFolder = repositoryService.getRootFolder("*");
Console.WriteLine("Root folder OID = {0}\n", rootFolder.objectID);
try
{
repositoryService.getRootFolder("a");
}
catch (FaultException<basicFault> e)
{
Console.WriteLine(e.Message);
}
try
{
objectService.getProperties(rootFolder + "1", versionEnum.@this, "*");
}
catch (FaultException e)
{
Console.WriteLine(e.Message);
}
bool hasMoreItems;
documentOrFolderObjectType[] rootFolderListing = navigationService.getChildren(rootFolder.objectID, typesOfObjectsEnum.FoldersAndDocumets, "*", null, null,
out hasMoreItems);
string guestFolderOID = null;
Console.WriteLine("Root folder listing: ");
foreach (documentOrFolderObjectType docFolder in rootFolderListing)
{
if (docFolder.name == "Guest Home")
{
guestFolderOID = docFolder.objectID;
}
Console.WriteLine(docFolder.name);
}
if (guestFolderOID != null)
{
Console.Write("\nGet children for bad OID, error : ");
try
{
navigationService.getChildren(guestFolderOID + 1, typesOfObjectsEnum.FoldersAndDocumets, "*", null, null,
out hasMoreItems);
}
catch (FaultException e)
{
Console.WriteLine(e.Message);
}
documentOrFolderObjectType[] guestFolderListing =
navigationService.getChildren(guestFolderOID, typesOfObjectsEnum.FoldersAndDocumets, "*", null, null,
out hasMoreItems);
string alfrescoTutOID = null;
Console.WriteLine("\nGuest folder listing: ");
foreach (documentOrFolderObjectType docFolder in guestFolderListing)
{
if (docFolder.name == "Alfresco-Tutorial.pdf")
{
alfrescoTutOID = docFolder.objectID;
}
Console.WriteLine(docFolder.name);
}
if (alfrescoTutOID != null)
{
byte[] bytes = objectService.getContentStream(alfrescoTutOID, null, "100");
Console.WriteLine("\nAlfresco-Tutorial.pdf retrieved");
}
}
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CmisTest")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("UTL")]
[assembly: AssemblyProduct("CmisTest")]
[assembly: AssemblyCopyright("Copyright © UTL 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("43cb4231-e775-417e-bc2c-4fd2d6ed15ea")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="RepositoryServiceSoapBinding" messageEncoding="Text">
<security mode="TransportWithMessageCredential">
<transport />
<message clientCredentialType="UserName" />
</security>
</binding>
<binding name="NavigationServiceSoapBinding" messageEncoding="Text">
<security mode="TransportWithMessageCredential">
<transport />
<message clientCredentialType="UserName" />
</security>
</binding>
<binding name="ObjectServiceSoapBinding" messageEncoding="Mtom">
<security mode="TransportWithMessageCredential">
<transport />
<message clientCredentialType="UserName" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://localhost:8443/alfresco/cmis/RepositoryService"
binding="basicHttpBinding" bindingConfiguration="RepositoryServiceSoapBinding"
contract="RepositoryServicePort" name="RepositoryServicePort" />
<endpoint address="https://localhost:8443/alfresco/cmis/NavigationService"
binding="basicHttpBinding" bindingConfiguration="NavigationServiceSoapBinding"
contract="NavigationServicePort" name="NavigationServicePort" />
<endpoint address="https://localhost:8443/alfresco/cmis/ObjectService"
binding="basicHttpBinding" bindingConfiguration="ObjectServiceSoapBinding"
contract="ObjectServicePort" name="ObjectServicePort" />
</client>
</system.serviceModel>
</configuration>

Binary file not shown.

Binary file not shown.