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\Online | ClientBaseExtensions.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 | 112 |
| 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.Identit yModel.Tok ens; | |||||
| 20 | using Syst em.Service Model; | |||||
| 21 | using Syst em.Service Model.Chan nels; | |||||
| 22 | using Syst em.Service Model.Secu rity; | |||||
| 23 | ||||||
| 24 | using Micr osoft.Iden tityModel. Protocols. WSTrust; | |||||
| 25 | ||||||
| 26 | public sta tic class ClientBase Extensions | |||||
| 27 | { | |||||
| 28 | pu blic stati c Binding ConfigureC rmOnlineBi nding<TCha nnel>(this ClientBas e<TChannel > client, Uri issuer Uri) | |||||
| 29 | wher e TChannel : class | |||||
| 30 | { | |||||
| 31 | if ( null == cl ient) | |||||
| 32 | { | |||||
| 33 | throw new Argume ntNullExce ption("cli ent"); | |||||
| 34 | } | |||||
| 35 | ||||||
| 36 | //Wh en this is represent ed in the configurat ion file, it attempt s to show the CardSp ace dialog . | |||||
| 37 | //As a workaro und, the b inding is being setu p manually using cod e. | |||||
| 38 | Tran sportSecur ityBinding Element se curityElem ent = new TransportS ecurityBin dingElemen t(); | |||||
| 39 | secu rityElemen t.DefaultA lgorithmSu ite = Secu rityAlgori thmSuite.T ripleDes; | |||||
| 40 | secu rityElemen t.MessageS ecurityVer sion = Mes sageSecuri tyVersion. WSSecurity 11WSTrust1 3WSSecureC onversatio n13WSSecur ityPolicy1 2BasicSecu rityProfil e10; | |||||
| 41 | secu rityElemen t.Endpoint Supporting TokenParam eters.Sign ed.Add( | |||||
| 42 | new Sy stem.Servi ceModel.Se curity.Tok ens.Issued SecurityTo kenParamet ers() | |||||
| 43 | { | |||||
| 44 | RequireD erivedKeys = false, | |||||
| 45 | KeySize = 192, | |||||
| 46 | IssuerAd dress = ne w Endpoint Address(is suerUri), | |||||
| 47 | }); | |||||
| 48 | ||||||
| 49 | //Cr eate a new list of t he binding elements | |||||
| 50 | List <BindingEl ement> ele mentList = new List< BindingEle ment>(); | |||||
| 51 | elem entList.Ad d(security Element); | |||||
| 52 | elem entList.Ad dRange(cli ent.Endpoi nt.Binding .CreateBin dingElemen ts()); | |||||
| 53 | ||||||
| 54 | Bind ing bindin g = new Cu stomBindin g(elementL ist); | |||||
| 55 | clie nt.Channel Factory.En dpoint.Bin ding = bin ding; | |||||
| 56 | ||||||
| 57 | //Co nfigure th e channel factory fo r use with federatio n | |||||
| 58 | clie nt.Channel Factory.Co nfigureCha nnelFactor y(); | |||||
| 59 | retu rn client. Endpoint.B inding; | |||||
| 60 | } | |||||
| 61 | ||||||
| 62 | pu blic stati c TChannel CreateCha nnel<TChan nel>(this ClientBase <TChannel> client, S ecurityTok en token) | |||||
| 63 | wher e TChannel : class | |||||
| 64 | { | |||||
| 65 | if ( null == cl ient) | |||||
| 66 | { | |||||
| 67 | throw new Argume ntNullExce ption("cli ent"); | |||||
| 68 | } | |||||
| 69 | ||||||
| 70 | if ( null == to ken) | |||||
| 71 | { | |||||
| 72 | return client.Ch annelFacto ry.CreateC hannel(); | |||||
| 73 | } | |||||
| 74 | ||||||
| 75 | lock (client.C hannelFact ory) | |||||
| 76 | { | |||||
| 77 | return client.Ch annelFacto ry.CreateC hannelWith IssuedToke n(token); | |||||
| 78 | } | |||||
| 79 | } | |||||
| 80 | } | |||||
| 81 | ||||||
| 82 | #region Ov errides fo r the clie nts | |||||
| 83 | namespace Microsoft. Crm.Sdk.Sa mples.CrmS dk.Discove ry | |||||
| 84 | { | |||||
| 85 | pa rtial clas s Discover yServiceCl ient | |||||
| 86 | { | |||||
| 87 | #reg ion Proper ties | |||||
| 88 | publ ic Securit yToken Tok en { get; set; } | |||||
| 89 | #end region | |||||
| 90 | ||||||
| 91 | prot ected over ride IDisc overyServi ce CreateC hannel() | |||||
| 92 | { | |||||
| 93 | return this.Crea teChannel( this.Token ); | |||||
| 94 | } | |||||
| 95 | } | |||||
| 96 | } | |||||
| 97 | ||||||
| 98 | namespace Microsoft. Crm.Sdk.Sa mples.CrmS dk | |||||
| 99 | { | |||||
| 100 | pa rtial clas s Organiza tionServic eClient | |||||
| 101 | { | |||||
| 102 | #reg ion Proper ties | |||||
| 103 | publ ic Securit yToken Tok en { get; set; } | |||||
| 104 | #end region | |||||
| 105 | ||||||
| 106 | prot ected over ride IOrga nizationSe rvice Crea teChannel( ) | |||||
| 107 | { | |||||
| 108 | return this.Crea teChannel( this.Token ); | |||||
| 109 | } | |||||
| 110 | } | |||||
| 111 | } | |||||
| 112 | #endregion |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.