Produced by Araxis Merge on 2/1/2017 2:56:56 PM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | C:\Araxis_Merge_Comprasion\Pub_un\BTSSS_CIF_122016.zip\BTSSS_CIF_12_20_16\clean\CRM\trunk\SDK\SampleCode\CS\WsdlBasedProxies\ADClaims | Program.cs | Tue Dec 20 19:51:47 2016 UTC |
| 2 | Wed Feb 1 19:56:56 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 1 | 123 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | // ======= ========== ========== ========== ========== ========== ========== == | |||||
| 2 | // | |||||
| 3 | // This f ile is par t of the M icrosoft D ynamics CR M SDK code samples. | |||||
| 4 | // | |||||
| 5 | // Copyri ght (C) Mi crosoft Co rporation. All righ ts reserve d. | |||||
| 6 | // | |||||
| 7 | // This s ource code is intend ed only as a supplem ent to Mic rosoft | |||||
| 8 | // Develo pment Tool s and/or o n-line doc umentation . See the se other | |||||
| 9 | // materi als for de tailed inf ormation r egarding M icrosoft c ode sample s. | |||||
| 10 | // | |||||
| 11 | // THIS C ODE AND IN FORMATION ARE PROVID ED "AS IS" WITHOUT W ARRANTY OF ANY | |||||
| 12 | // KIND, EITHER EXP RESSED OR IMPLIED, I NCLUDING B UT NOT LIM ITED TO TH E | |||||
| 13 | // IMPLIE D WARRANTI ES OF MERC HANTABILIT Y AND/OR F ITNESS FOR A | |||||
| 14 | // PARTIC ULAR PURPO SE. | |||||
| 15 | // | |||||
| 16 | // ======= ========== ========== ========== ========== ========== ========== == | |||||
| 17 | using Syst em; | |||||
| 18 | using Syst em.Collect ions.Gener ic; | |||||
| 19 | using Syst em.Globali zation; | |||||
| 20 | using Syst em.Net; | |||||
| 21 | using Syst em.Service Model; | |||||
| 22 | using Syst em.Service Model.Desc ription; | |||||
| 23 | ||||||
| 24 | namespace Microsoft. Crm.Sdk.Sa mples | |||||
| 25 | { | |||||
| 26 | us ing CrmSdk ; | |||||
| 27 | us ing CrmSdk .Discovery ; | |||||
| 28 | ||||||
| 29 | in ternal sta tic class Program | |||||
| 30 | { | |||||
| 31 | #reg ion Consta nts | |||||
| 32 | /// <summary> | |||||
| 33 | /// User Domai n | |||||
| 34 | /// </summary> | |||||
| 35 | priv ate const string Use rDomain = "mydomain" ; | |||||
| 36 | ||||||
| 37 | /// <summary> | |||||
| 38 | /// User Name | |||||
| 39 | /// </summary> | |||||
| 40 | priv ate const string Use rName = "u sername"; | |||||
| 41 | ||||||
| 42 | /// <summary> | |||||
| 43 | /// Password | |||||
| 44 | /// </summary> | |||||
| 45 | priv ate const string Use rPassword = "passwor d"; | |||||
| 46 | ||||||
| 47 | /// <summary> | |||||
| 48 | /// Unique Nam e of the o rganizatio n | |||||
| 49 | /// </summary> | |||||
| 50 | priv ate const string Org anizationU niqueName = "orgname "; | |||||
| 51 | ||||||
| 52 | /// <summary> | |||||
| 53 | /// URL for th e Discover y Service | |||||
| 54 | /// </summary> | |||||
| 55 | priv ate const string Dis coveryServ iceUrl = " https://my server/XRM Services/2 011/Discov ery.svc"; | |||||
| 56 | #end region | |||||
| 57 | ||||||
| 58 | stat ic void Ma in(string[ ] args) | |||||
| 59 | { | |||||
| 60 | //Gene rate the c redentials | |||||
| 61 | Client Credential s credenti als = new ClientCred entials(); | |||||
| 62 | creden tials.Wind ows.Client Credential = new Net workCreden tial(UserN ame, UserP assword, U serDomain) ; | |||||
| 63 | ||||||
| 64 | //Exec ute the sa mple | |||||
| 65 | string serviceUr l = Discov erOrganiza tionUrl(cr edentials, Organizat ionUniqueN ame, Disco veryServic eUrl); | |||||
| 66 | Execut eWhoAmI(cr edentials, serviceUr l); | |||||
| 67 | } | |||||
| 68 | ||||||
| 69 | priv ate static string Di scoverOrga nizationUr l(ClientCr edentials credential s, string organizat ionName, s tring disc overyServi ceUrl) | |||||
| 70 | { | |||||
| 71 | using (Discovery ServiceCli ent client = new Dis coveryServ iceClient( "CustomBin ding_IDisc overyServi ce", disco veryServic eUrl)) | |||||
| 72 | { | |||||
| 73 | ApplyCre dentials(c lient, cre dentials); | |||||
| 74 | ||||||
| 75 | Retrieve Organizati onRequest request = new Retrie veOrganiza tionReques t() | |||||
| 76 | { | |||||
| 77 | UniqueName = organiz ationName | |||||
| 78 | }; | |||||
| 79 | Retrieve Organizati onResponse response = (Retriev eOrganizat ionRespons e)client.E xecute(req uest); | |||||
| 80 | foreach (KeyValueP air<CrmSdk .Discovery .EndpointT ype, strin g> endpoin t in respo nse.Detail .Endpoints ) | |||||
| 81 | { | |||||
| 82 | if (CrmSdk .Discovery .EndpointT ype.Organi zationServ ice == end point.Key) | |||||
| 83 | { | |||||
| 84 | Co nsole.Writ eLine("Org anization Service UR L: {0}", e ndpoint.Va lue); | |||||
| 85 | re turn endpo int.Value; | |||||
| 86 | } | |||||
| 87 | } | |||||
| 88 | ||||||
| 89 | throw ne w InvalidO perationEx ception(st ring.Forma t(CultureI nfo.Invari antCulture , | |||||
| 90 | "Organizat ion {0} do es not hav e an Organ izationSer vice endpo int define d.", organ izationNam e)); | |||||
| 91 | } | |||||
| 92 | } | |||||
| 93 | ||||||
| 94 | priv ate static void Exec uteWhoAmI( ClientCred entials cr edentials, string se rviceUrl) | |||||
| 95 | { | |||||
| 96 | using (Organizat ionService Client cli ent = new Organizati onServiceC lient("Cus tomBinding _IOrganiza tionServic e", | |||||
| 97 | new Endp ointAddres s(serviceU rl))) | |||||
| 98 | { | |||||
| 99 | ApplyCre dentials(c lient, cre dentials); | |||||
| 100 | ||||||
| 101 | Organiza tionReques t request = new Orga nizationRe quest(); | |||||
| 102 | request. RequestNam e = "WhoAm I"; | |||||
| 103 | ||||||
| 104 | Organiza tionRespon se respons e = (Organ izationRes ponse)clie nt.Execute (request); | |||||
| 105 | ||||||
| 106 | foreach (KeyValueP air<string , object> result in response.R esults) | |||||
| 107 | { | |||||
| 108 | if ("UserI d" == resu lt.Key) | |||||
| 109 | { | |||||
| 110 | Co nsole.Writ eLine("Use r ID: {0}" , result.V alue); | |||||
| 111 | br eak; | |||||
| 112 | } | |||||
| 113 | } | |||||
| 114 | } | |||||
| 115 | } | |||||
| 116 | ||||||
| 117 | priv ate static void Appl yCredentia ls<TChanne l>(ClientB ase<TChann el> client , ClientCr edentials credential s) | |||||
| 118 | where TChannel : class | |||||
| 119 | { | |||||
| 120 | client .ClientCre dentials.W indows.Cli entCredent ial = cred entials.Wi ndows.Clie ntCredenti al; | |||||
| 121 | } | |||||
| 122 | } | |||||
| 123 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.