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 ;
        }


     

  • 相关阅读:
    第八周学习进度总结
    全国(球)疫情信息可视化
    第六周学习进度总结
    手把手教你爬取B站弹幕!
    Xpath基础学习
    团队成员及选题介绍
    第五周学习进度
    课堂练习之疫情APP
    SpringMVC02
    06 | 链表(上):如何实现LRU缓存淘汰算法?
  • 原文地址:https://www.cnblogs.com/BinBinGo/p/9981687.html
Copyright © 2011-2022 走看看