Produced by Araxis Merge on 5/23/2019 1:16:31 PM Eastern Daylight 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 | PATS_R_SourceCode.zip\MVI Search\MVI Search.Plugins | TestAction.cs | Thu Mar 28 17:54:52 2019 UTC |
2 | PATS_R_SourceCode.zip\MVI Search\MVI Search.Plugins | TestAction.cs | Thu May 23 01:31:43 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 210 |
Changed | 1 | 2 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
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 | using Micr osoft.Xrm. Sdk; | |
2 | using VEIS .Plugins.M essages; | |
3 | using VEIS .Plugins.M odels; | |
4 | using Syst em; | |
5 | using Syst em.Activit ies; | |
6 | using Syst em.Collect ions.Gener ic; | |
7 | using Syst em.IO; | |
8 | using Syst em.Linq; | |
9 | using Syst em.Net; | |
10 | using Syst em.Text; | |
11 | using Syst em.Threadi ng.Tasks; | |
12 | ||
13 | namespace VEIS.Plugi ns | |
14 | { | |
15 | public class Tes tAction : BaseAction | |
16 | { | |
17 | pr otected ov erride voi d Execute( CodeActivi tyContext context) | |
18 | { | |
19 | try | |
20 | { | |
21 | //MO DEBUG wire up the ve isConfigur ation need to move t his to set tings | |
22 | Mode ls.VeisCon figuration veisConfi guration = new Model s.VeisConf iguration( ) | |
23 | { | |
24 | CRMAuthInf o = new Mo dels.CRMAu thTokenCon figuration () | |
25 | { | |
26 | Client Applicatio nId = "58d 50ca3-b921 -4d9b-ac76 -8965be2eb 80b", | |
27 | Client Secret = " 4RdVDdhq8c v/h2263Ojd y8fD3JI9Ow Hcr5hOkntA wTc=", | |
28 | Tenant Id = "f7c4 9e36-971b- 42c7-b244- a88eed6c0b f6", | |
29 | Resour ceId = "4a 77476c-cee d-45db-ad7 e-ac2bbbc4 f72a" | |
30 | }, | |
31 | SvcConfigI nfo = new Models.VEI SSvcLOBCon figuration () | |
32 | { | |
33 | ApimSu bscription Key = "45f 51ebbff354 1ad8f3faf5 84499498f" , | |
34 | SvcLOBServ iceUrl = " https:// DNS . URL /veis/EC/M VIService/ api/", | |
35 | } | |
36 | }; | |
37 | ||
38 | Pers onSearchRe quest sear chRequest = new Pers onSearchRe quest(); | |
39 | //Se tQueryStri ng(config, localCont ext, (Pers onSearchRe quest)sear chRequest, request.Q uery.crite ria); | |
40 | sear chRequest. MessageId = Guid.New Guid().ToS tring(); | |
41 | sear chRequest. Organizati onName = " TEST"; | |
42 | sear chRequest. UserId = n ew Guid(); | |
43 | sear chRequest. Debug = fa lse; | |
44 | sear chRequest. LogSoap = false; | |
45 | sear chRequest. LogTiming = false; | |
46 | ||
47 | ||
48 | var searchResp onse = Sen dReceiveVe isRequest< PersonSear chResponse >(new Uri( veisConfig uration.Sv cConfigInf o.SvcLOBSe rviceUrl), "SearchPe rson", sea rchRequest , veisConf iguration) ; | |
49 | } | |
50 | catch (E xception e x) | |
51 | { | |
52 | thro w new Inva lidPluginE xecutionEx ception(We bApiUtilit y.BuildExc eptionMess age(ex)); | |
53 | } | |
54 | } | |
55 | ||
56 | pu blic stati c T SendRe ceiveVeisR equest<T>( Uri baseUr i, string messageId, VeisReque st request , VeisConf iguration config) | |
57 | { | |
58 | try | |
59 | { | |
60 | if ( (System.Ne t.ServiceP ointManage r.Security Protocol & SecurityP rotocolTyp e.Tls12) = = 0) | |
61 | { | |
62 | System.Net .ServicePo intManager .SecurityP rotocol = SecurityPr otocolType .Tls | Sec urityProto colType.Tl s11 | Secu rityProtoc olType.Tls 12; | |
63 | } | |
64 | ||
65 | usin g (WebClie nt client = new WebC lient()) | |
66 | { | |
67 | Uri uri; | |
68 | if (config .SvcConfig Info.SvcLO BServiceUr l.EndsWith ("/")) | |
69 | { | |
70 | uri = new Uri(co nfig.SvcCo nfigInfo.S vcLOBServi ceUrl + me ssageId); | |
71 | } | |
72 | else | |
73 | { | |
74 | uri = new Uri(co nfig.SvcCo nfigInfo.S vcLOBServi ceUrl + "/ " + messag eId); | |
75 | } | |
76 | client.Add AuthHeader (config.CR MAuthInfo) ; | |
77 | Console.Wr iteLine("A uth Header : " + clie nt.Headers [HttpReque stHeader.A uthorizati on]); | |
78 | string req Body = Jso nHelper.Se rialize(re quest); | |
79 | client.Hea ders[HttpR equestHead er.Content Type] = "a pplication /json"; | |
80 | client.Hea ders.Add(" Ocp-Apim-S ubscriptio n-Key", co nfig.SvcCo nfigInfo.A pimSubscri ptionKey); | |
81 | string res ponse = cl ient.Uploa dString(ur i.Absolute Uri, reqBo dy); | |
82 | return Jso nHelper.De serialize< T>(respons e); | |
83 | } | |
84 | } | |
85 | ||
86 | catch (W ebExceptio n exceptio n) | |
87 | { | |
88 | stri ng callRes ponse = st ring.Empty ; | |
89 | if ( exception. Response ! = null) | |
90 | { | |
91 | using (Str eamReader reader = n ew StreamR eader(exce ption.Resp onse.GetRe sponseStre am())) | |
92 | { | |
93 | callRe sponse = r eader.Read ToEnd(); | |
94 | } | |
95 | exception. Response.C lose(); | |
96 | } | |
97 | if ( exception. Status == WebExcepti onStatus.T imeout) | |
98 | { | |
99 | throw new Exception( "The timeo ut elapsed while att empting to issue the request." , exceptio n); | |
100 | } | |
101 | thro w new Exce ption($"A Web except ion occurr ed while a ttempting to issue t he request . {excepti on.Message }: {callRe sponse}", exception) ; | |
102 | } | |
103 | } | |
104 | ||
105 | } | |
106 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.