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


     

  • 相关阅读:
    python流程控制
    数据类型
    python之初接触
    使用 HttpWebRequest 向网站提交数据
    在 ASP.NET MVC4 中使用 NInject
    第一篇 微信商城 开发前的准备工作
    (一)模块基础
    函数之递归、匿名函数及内置方法
    装饰器的使用原理
    mybatis返回list
  • 原文地址:https://www.cnblogs.com/BinBinGo/p/9981687.html
Copyright © 2011-2022 走看看