zoukankan      html  css  js  c++  java
  • mscrm WebService开发 之 CrmDiscoveryService

    代码
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using CrmDiscoveryWeservice.CrmSdk.Discovery;

    namespace CrmDiscoveryWeservice
    {
        
    /// <summary>
        
    /// author:seer lin
        
    /// description:demo of using the CrmDiscoveryService to retrieve organization infomation
        
    /// </summary>
        public partial class Form1 : Form
        {
            
    public Form1()
            {
                InitializeComponent();
            }

            
    private void button1_Click(object sender, EventArgs e)
            {
                CrmDiscoveryService discoveryService 
    = new CrmDiscoveryService();
                discoveryService.UseDefaultCredentials 
    = true;
                discoveryService.Url 
    = "http://localhost:5555/MSCRMServices/2007/AD/CrmDiscoveryService.asmx";

                RetrieveOrganizationsRequest orgRequest 
    = new RetrieveOrganizationsRequest();
                RetrieveOrganizationsResponse orgResponse 
    = (RetrieveOrganizationsResponse)discoveryService.Execute(orgRequest);

                
    foreach (OrganizationDetail orgDetail in orgResponse.OrganizationDetails)
                {
                    MessageBox.Show(
    "组织名称为:"+orgDetail.OrganizationName + "\nWebService访问地址:"+orgDetail.CrmServiceUrl);
                }
            }
        }
    }
  • 相关阅读:
    一.创建型模式 Factory
    Tcp/Ip I/O函数
    Tcp/Ip协议理解_简单实例
    Tcp/Ip协议理解_3
    Tcp/Ip协议理解_2
    Tcp/Ip协议理解_1
    abp+angular+bootstrap-table的使用
    Abp mvc angular 添加视图
    Abp添加菜单
    JS 获取一串路径中的文件名称
  • 原文地址:https://www.cnblogs.com/seerlin/p/1756481.html
Copyright © 2011-2022 走看看