1

I want to connect to Alfresco with DotCMIS but I dont seem to get it working. I get this error "Error: The provided URI scheme 'http' is invalid; expected 'https'." I don't do anything with https and I don't want to either :)

When I Google for this error I get configuration solutions... but I don't use my configuration for any binding or define a binding name in DotCMIS.

I've made a little example project that creates the error. CODE:

private static void Main(string[] args)
        {
            string user = "admin";
            string password = "pass";
            string serviceUrl = "http://localhost:port/alfresco/cmis/";
            string objectType = "D:my:objectType";
            string repositoryid = "repositoryId";

            Connector con = new Connector();
            con.Connect(user, password, serviceUrl, repositoryid, objectType);
        }
    }

    public class Connector
    {
        public void Connect(
            string user, string password, string servicesUrl,
            string repositoryId, string objectTypeId_0)
        {
            // default factory implementation
            IDictionary<string, string> parameter = new Dictionary<string, string>();

            // user credentials
            parameter.Add((System.String) (DotCMIS.SessionParameter.User), (System.String) (user));
            parameter.Add((System.String) (DotCMIS.SessionParameter.Password), (System.String) (password));

            // connection settings
            parameter.Add(
                (System.String) (DotCMIS.SessionParameter.BindingType),
                (System.String) (DotCMIS.BindingType.WebServices.ToString()));

            parameter.Add(
                (System.String) (DotCMIS.SessionParameter.WebServicesAclService), (System.String) (servicesUrl
                                                                                                   + "ACLService?wsdl"));
            parameter.Add(
                (System.String) (DotCMIS.SessionParameter.WebServicesDiscoveryService),
                (System.String) (servicesUrl + "DiscoveryService?wsdl"));
            parameter.Add(
                (System.String) (DotCMIS.SessionParameter.WebServicesMultifilingService),
                (System.String) (servicesUrl + "MultiFilingService?wsdl"));
            parameter.Add(
                (System.String) (DotCMIS.SessionParameter.WebServicesNavigationService),
                (System.String) (servicesUrl + "NavigationService?wsdl"));
            parameter.Add(
                (System.String) (DotCMIS.SessionParameter.WebServicesObjectService), (System.String) (servicesUrl
                                                                                                      +
                                                                                                      "ObjectService?wsdl"));
            parameter.Add(
                (System.String) (DotCMIS.SessionParameter.WebServicesPolicyService), (System.String) (servicesUrl
                                                                                                      +
                                                                                                      "PolicyService?wsdl"));
            parameter.Add(
                (System.String) (DotCMIS.SessionParameter.WebServicesRelationshipService),
                (System.String) (servicesUrl + "RelationshipService?wsdl"));
            parameter.Add(
                (System.String) (DotCMIS.SessionParameter.WebServicesRepositoryService),
                (System.String) (servicesUrl + "RepositoryService?wsdl"));
            parameter.Add(
                (System.String) (DotCMIS.SessionParameter.WebServicesVersioningService),
                (System.String) (servicesUrl + "VersioningService?wsdl"));
            parameter.Add((System.String) (DotCMIS.SessionParameter.RepositoryId), (System.String) (repositoryId));


            ISessionFactory factory = DotCMIS.Client.Impl.SessionFactory.NewInstance();

            ISession session = factory.CreateSession(parameter);
        }
BvdVen
  • 2,921
  • 23
  • 33
  • Have you perhaps told .Net that it should be requiring https for certain kinds of webservices? Does it work if you switch to atompub? – Gagravarr Jun 19 '13 at 12:10
  • When I use AtomPub it seems to work... (But I need to use the webservice) I didn't set anything to tell .Net to use https... I created a simple Console project. – BvdVen Jun 19 '13 at 12:29

1 Answers1

3

Check the DotCMIS README file:

The Web Services binding only works with HTTPS. The .NET framework does not allow calls with UsernameTokens over plain HTTP.

You have to use HTTPS here.

Florian Müller
  • 3,215
  • 1
  • 14
  • 11
  • Thank you, I will look into that... I think it's a bit weird that in the DotCMIS example page they don't use https then. (http://chemistry.apache.org/dotnet/getting-started-with-dotcmis.html) – BvdVen Jun 19 '13 at 16:10