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


     

  • 相关阅读:
    在Android中使用Handler和Thread线程
    getCacheDir用法
    OAuth协议
    android开发参考网站
    常用的地址
    LayoutInflater获取方式
    java for map
    ubuntu12.04+nginx+apc
    ubuntu12.04 + dropbox
    yii + 获取 control + action
  • 原文地址:https://www.cnblogs.com/BinBinGo/p/9981687.html
Copyright © 2011-2022 走看看