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


     

  • 相关阅读:
    Cocos2d-x 2.x项目创建
    Mac OS 使用Git
    Android Studio And Gradle
    Mac OS环境变量配置(Android Studio之Gradle)
    【Android UI】 Shape详解
    JS-OC通信之Cordova简介
    python类的定义和使用
    Android屏幕适配常识
    Python面试315题
    第十五篇 Python之文件处理
  • 原文地址:https://www.cnblogs.com/BinBinGo/p/9981687.html
Copyright © 2011-2022 走看看