Produced by Araxis Merge on 6/9/2017 3:50:57 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 | Fri Jun 9 19:50:57 2017 UTC | ||
| 2 | eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\VAP_CIF_CODE0502.zip\VAP_CIF_CODE0502\VAP_CIF_CODE0502\nvap-server\src\main\java\gov\va\nvap\server\endpoint\permission\pdp | XACMLWebServiceTemplate.java | Fri Apr 21 20:03:28 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 70 |
| 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.nvap. server.end point.perm ission.pdp ; | |||||
| 2 | ||||||
| 3 | import jav ax.xml.bin d.JAXBElem ent; | |||||
| 4 | ||||||
| 5 | import oas is.names.t c.xacml._2 _0.context .schema.os .ObjectFac tory; | |||||
| 6 | import oas is.names.t c.xacml._2 _0.context .schema.os .RequestTy pe; | |||||
| 7 | import oas is.names.t c.xacml._2 _0.context .schema.os .ResponseT ype; | |||||
| 8 | ||||||
| 9 | import org .springfra mework.ws. WebService MessageFac tory; | |||||
| 10 | import org .springfra mework.ws. client.cor e.WebServi ceTemplate ; | |||||
| 11 | ||||||
| 12 | // based o n http://s pringwstem platejax2b xmlrootmis sing.blogs pot.com/ | |||||
| 13 | public cla ss XACMLWe bServiceTe mplate ext ends WebSe rviceTempl ate { | |||||
| 14 | ||||||
| 15 | /* * | |||||
| 16 | * Creates a new <code >WebServic eTemplate< /code> bas ed on the given mess age | |||||
| 17 | * factory. | |||||
| 18 | * | |||||
| 19 | * @param me ssageFacto ry | |||||
| 20 | * the mess age factor y to use | |||||
| 21 | * / | |||||
| 22 | pu blic XACML WebService Template(f inal WebSe rviceMessa geFactory messageFac tory) { | |||||
| 23 | supe r(messageF actory); | |||||
| 24 | } | |||||
| 25 | ||||||
| 26 | @O verride | |||||
| 27 | pu blic Respo nseType ma rshalSendA ndReceive( final Obje ct request Payload) { | |||||
| 28 | Resp onseType r esponse = null; | |||||
| 29 | ||||||
| 30 | // t ype cast t he object to the spe cific requ est object . Using ge nerics | |||||
| 31 | // h elps to us e it for a ll the gen erated JAX B objects | |||||
| 32 | fina l RequestT ype reques t = (Reque stType) re questPaylo ad; | |||||
| 33 | /* | |||||
| 34 | * t ry { Strin g fieldNam e = "_Requ est_QNAME" ; | |||||
| 35 | * | |||||
| 36 | * / / lookup t he private QNAME obj ect for th e request object dec lared // | |||||
| 37 | * i n the gene rated Obje ctFactory Field fiel d = | |||||
| 38 | * O bjectFacto ry.class.g etDeclared Field(fiel dName); | |||||
| 39 | * f ield.setAc cessible(t rue); if ( field.getN ame().equa ls(fieldNa me)) { | |||||
| 40 | * / / create t he JAXB El ement for the given class Fiel d requestF ield = | |||||
| 41 | * t his.getCla ss().getDe claredFiel d( "reques tType"); / / get the class | |||||
| 42 | * t ype of gen eric JAXB input obje ct Class r equestClas s = | |||||
| 43 | * r equestFiel d.getDecla ringClass( ); JAXBEle ment<Reque stType> | |||||
| 44 | * j axbElement = new JAX BElement<R equestType >( (QName) field.get (null), | |||||
| 45 | * r equestClas s, null, r equest); / / invoke t he super c lass metho d with | |||||
| 46 | * t he JAXBEle ment and t ype // cas t the resp onse JAXBE lement to the | |||||
| 47 | * g eneric res ponse type // object . JAXBElem ent<Respon seType> | |||||
| 48 | * r esponseObj ect = (JAX BElement<R esponseTyp e>) super | |||||
| 49 | * . marshalSen dAndReceiv e(jaxbElem ent); if ( responseOb ject != nu ll) { | |||||
| 50 | * r esponse = responseOb ject.getVa lue(); } } } catch ( Exception | |||||
| 51 | * e xception) { exceptio n.printSta ckTrace(); } | |||||
| 52 | * | |||||
| 53 | * J AXBElement <RequestTy pe> jaxbEl ement = ne w JAXBElem ent<Reques tType>( | |||||
| 54 | * n ew QName(" urn:oasis: names:tc:x acml:2.0:c ontext:sch ema:os", | |||||
| 55 | * " Request"), (Class<Re questType> ) request. getClass() , request) ; | |||||
| 56 | */ | |||||
| 57 | fina l JAXBElem ent<Reques tType> jax bElement = new Objec tFactory() | |||||
| 58 | .createR equest(req uest); | |||||
| 59 | // i nvoke the super clas s method w ith the JA XBElement and type | |||||
| 60 | // c ast the re sponse JAX BElement t o the gene ric respon se type | |||||
| 61 | // o bject. | |||||
| 62 | fina l JAXBElem ent<Respon seType> re sponseObje ct = (JAXB Element<Re sponseType >) super | |||||
| 63 | .marshal SendAndRec eive(jaxbE lement); | |||||
| 64 | if ( responseOb ject != nu ll) { | |||||
| 65 | respon se = respo nseObject. getValue() ; | |||||
| 66 | } | |||||
| 67 | ||||||
| 68 | retu rn respons e; | |||||
| 69 | } | |||||
| 70 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.