zoukankan      html  css  js  c++  java
  • CRM 2016 Get IOrganizationService

    得到域认证下的IOrganizationService

        private IOrganizationService GetOrgService()
        {
    
            Uri orgServiceUri = new Uri("http://xxxx:5555/orgname/XRMServices/2011/Organization.svc");
            ClientCredentials credentials = new ClientCredentials();
            credentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;
            OrganizationServiceProxy crmServiceProxy = new OrganizationServiceProxy(orgServiceUri, null, credentials, null);
            IOrganizationService crmService = (IOrganizationService)crmServiceProxy;
    
            return crmService;
        }


    使用 用户名密码方式下的IOrganizationService

        private IOrganizationService GetOrgService()
        {
    
                    Uri orgServiceUri = new Uri("http://xxxx:5555/orgname/XrmServices/2011/Organization.svc");
                    ClientCredentials clientCredentials = new ClientCredentials();
                    clientCredentials.Windows.ClientCredential = new NetworkCredential("username", "password", "domain");
                    OrganizationServiceProxy proxy = new OrganizationServiceProxy(orgServiceUri, null, clientCredentials, null);
                    service = (IOrganizationService)proxy;
    
            return service ;
        }


     

  • 相关阅读:
    MongoDB 部署复制集(副本集)
    MongoDB shell 2 副本集方法
    MongoDB shell 1 数据库方法
    MongoDB shell 0 集合方法
    CentOS7 安装 zabbix
    MongoDB Shell db.runCommand
    MongoDB Index
    MongoDB 启动报错
    MongoDB 聚合查询报错
    MongoDB 聚合函数
  • 原文地址:https://www.cnblogs.com/BinBinGo/p/9981687.html
Copyright © 2011-2022 走看看