mscrm WebService开发 之CrmDiscoveryService

mac2022-06-30  16

代码 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);            }        }    }}

 

转载于:https://www.cnblogs.com/seerlin/archive/2010/06/11/1756481.html

最新回复(0)