Produced by Araxis Merge on 4/2/2019 9:48:36 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 | JLV_JLV 2_7_2_0_0.zip\JLV_Src\JLV\src\java\gov\va\med\jmeadows | HeaderHandler.java | Wed Mar 20 21:44:28 2019 UTC |
2 | JLV_JLV 2_7_2_0_0.zip\JLV_Src\JLV\src\java\gov\va\med\jmeadows | HeaderHandler.java | Tue Apr 2 13:35:47 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 212 |
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 | package go v.va.med.j meadows; | |
2 | ||
3 | /** | |
4 | * Created with Inte lliJ IDEA. | |
5 | * User: DNS | |
6 | * Date: 9 /6/14 | |
7 | * Time: 1 1:08 PM | |
8 | * To chan ge this te mplate use File | Se ttings | F ile Templa tes. | |
9 | */ | |
10 | ||
11 | import gov .va.med.co mmon.AppCo nfig; | |
12 | import gov .va.med.fo undations. utilities. EncryptUti l; | |
13 | import org .apache.lo g4j.Logger ; | |
14 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
15 | import org .springfra mework.ste reotype.Co mponent; | |
16 | ||
17 | import jav a.util.Set ; | |
18 | import jav ax.xml.nam espace.QNa me; | |
19 | import jav ax.xml.soa p.*; | |
20 | import jav ax.xml.ws. handler.Me ssageConte xt; | |
21 | import jav ax.xml.ws. handler.so ap.SOAPHan dler; | |
22 | import jav ax.xml.ws. handler.so ap.SOAPMes sageContex t; | |
23 | ||
24 | /** | |
25 | * @author www.javad b.com | |
26 | */ | |
27 | public cla ss HeaderH andler imp lements SO APHandler< SOAPMessag eContext> { | |
28 | ||
29 | @Autow ired | |
30 | protec ted AppCon fig appCon fig; | |
31 | privat e static f inal Logge r logger = Logger.ge tLogger(JM eadowsServ iceHandler Impl.class .getName() ); | |
32 | ||
33 | public boolean h andleMessa ge(SOAPMes sageContex t smc) { | |
34 | ||
35 | Bo olean outb oundProper ty = (Bool ean) smc.g et(Message Context.ME SSAGE_OUTB OUND_PROPE RTY); | |
36 | ||
37 | if (outbound Property.b ooleanValu e()) { | |
38 | ||
39 | //SOAPMe ssage mess age = smc. getMessage (); | |
40 | ||
41 | try { | |
42 | Stri ng userNam e = appCon fig.getJMe adowsUsern ame(); | |
43 | Stri ng passWor d = appCon fig.getJMe adowsPassw ord(); | |
44 | ||
45 | SOAP Envelope e nvelope = smc.getMes sage().get SOAPPart() .getEnvelo pe(); | |
46 | if ( envelope.g etHeader() == null) { | |
47 | envelope.a ddHeader() ; | |
48 | } | |
49 | SOAP Header hea der = enve lope.getHe ader(); | |
50 | ||
51 | SOAP Element se curity = | |
52 | header .addChildE lement("Se curity", " wsse", "ht tp://docs. oasis-open .org/wss/2 004/01/oas is-200401- wss-wssecu rity-secex t-1.0.xsd" ); | |
53 | ||
54 | SOAP Element us ernameToke n = | |
55 | securi ty.addChil dElement(" UsernameTo ken", "wss e"); | |
56 | user nameToken. addAttribu te(new QNa me("xmlns: wsu"), "ht tp://docs. oasis-open .org/wss/2 004/01/oas is-200401- wss-wssecu rity-utili ty-1.0.xsd "); | |
57 | ||
58 | SOAP Element us ername = | |
59 | userna meToken.ad dChildElem ent("Usern ame", "wss e"); | |
60 | user name.addTe xtNode(use rName); | |
61 | ||
62 | SOAP Element pa ssword = | |
63 | userna meToken.ad dChildElem ent("Passw ord", "wss e"); | |
64 | pass word.setAt tribute("T ype", "htt p://docs.o asis-open. org/wss/20 04/01/oasi s-200401-w ss-usernam e-token-pr ofile-1.0# PasswordTe xt"); | |
65 | pass word.addTe xtNode(pas sWord); | |
66 | ||
67 | //Pr int out th e outbound SOAP mess age to Sys tem.out | |
68 | //me ssage.writ eTo(System .out); | |
69 | //Sy stem.out.p rintln("") ; | |
70 | ||
71 | } catch (SOAPExcep tion e) { | |
72 | logg er.error(" Issue proc essing SOA P Message: " + e.get Message()) ; | |
73 | } | |
74 | ||
75 | } else { | |
76 | // try { | |
77 | ||
78 | //Th is handler does noth ing with t he respons e from the Web Servi ce so | |
79 | //we just prin t out the SOAP messa ge. | |
80 | // SO APMessage message = smc.getMes sage(); | |
81 | // me ssage.writ eTo(System .out); | |
82 | // Sy stem.out.p rintln("") ; | |
83 | logg er.debug(" This ws-se curity hea der handle r does not hing with the respon se from th e Web Serv ice, skipp ing..."); | |
84 | ||
85 | // } catc h (Excepti on ex) { | |
86 | // ex .printStac kTrace(); | |
87 | // } | |
88 | } | |
89 | ||
90 | re turn outbo undPropert y; | |
91 | ||
92 | } | |
93 | ||
94 | public Set getHe aders() { | |
95 | // throw new Unsupporte dOperation Exception( "Not suppo rted yet." ); | |
96 | re turn null; | |
97 | } | |
98 | ||
99 | public boolean h andleFault (SOAPMessa geContext context) { | |
100 | // throw new Unsupporte dOperation Exception( "Not suppo rted yet." ); | |
101 | re turn true; | |
102 | } | |
103 | ||
104 | public void clos e(MessageC ontext con text) { | |
105 | // throw new Unsupporte dOperation Exception( "Not suppo rted yet." ); | |
106 | } | |
107 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.