Last change
on this file since 507 was 507, checked in by George Lilly, 15 years ago |
NHIN gateway and adaptor for use on linux with VistA EHR and RPMS
|
File size:
1.5 KB
|
Line | |
---|
1 | /*
|
---|
2 | * To change this template, choose Tools | Templates
|
---|
3 | * and open the template in the editor.
|
---|
4 | */
|
---|
5 | package gov.hhs.fha.nhinc.subscription.dte;
|
---|
6 |
|
---|
7 | import javax.xml.parsers.DocumentBuilderFactory;
|
---|
8 | import javax.xml.parsers.ParserConfigurationException;
|
---|
9 | import javax.xml.ws.wsaddressing.W3CEndpointReference;
|
---|
10 | import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
|
---|
11 |
|
---|
12 | /**
|
---|
13 | *
|
---|
14 | * @author rayj
|
---|
15 | */
|
---|
16 | public class ConsumerReferenceHelper {
|
---|
17 |
|
---|
18 | public static W3CEndpointReference CreateConsumerReference(String notificationConsumerEndpointAddress, String userAddress) {
|
---|
19 | W3CEndpointReferenceBuilder endpointReferenceBuilder = new W3CEndpointReferenceBuilder();
|
---|
20 |
|
---|
21 | //notify address
|
---|
22 | endpointReferenceBuilder.address(notificationConsumerEndpointAddress);
|
---|
23 |
|
---|
24 | //user address
|
---|
25 | DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
|
---|
26 |
|
---|
27 | org.w3c.dom.Document doc;
|
---|
28 | try {
|
---|
29 | doc = docBuilderFactory.newDocumentBuilder().newDocument();
|
---|
30 | } catch (ParserConfigurationException ex) {
|
---|
31 | throw new RuntimeException("failed to parse document", ex);
|
---|
32 | }
|
---|
33 | org.w3c.dom.Element referenceParameter = doc.createElementNS("http://www.hhs.gov/healthit/nhin", "nhin:UserAddress");
|
---|
34 | referenceParameter.setTextContent(userAddress);
|
---|
35 | endpointReferenceBuilder.referenceParameter(referenceParameter);
|
---|
36 |
|
---|
37 | W3CEndpointReference ref = endpointReferenceBuilder.build();
|
---|
38 | return ref;
|
---|
39 | }
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.