1 | /*
|
---|
2 | * To change this template, choose Tools | Templates
|
---|
3 | * and open the template in the editor.
|
---|
4 | */
|
---|
5 |
|
---|
6 | package gov.hhs.fha.nhinc.docretrieve;
|
---|
7 |
|
---|
8 | import gov.hhs.fha.nhinc.common.nhinccommoninternalorch.RespondingGatewayCrossGatewayRetrieveRequestType;
|
---|
9 | import gov.hhs.fha.nhinc.nhincdocretrieve.NhincDocRetrievePortType;
|
---|
10 | import gov.hhs.fha.nhinc.nhincdocretrieve.NhincDocRetrieveService;
|
---|
11 | import gov.hhs.fha.nhinc.saml.extraction.SamlTokenExtractor;
|
---|
12 | import gov.hhs.fha.nhinc.saml.extraction.SamlTokenExtractorHelper;
|
---|
13 | import ihe.iti.xds_b._2007.RetrieveDocumentSetRequestType;
|
---|
14 | import ihe.iti.xds_b._2007.RetrieveDocumentSetResponseType;
|
---|
15 | import javax.xml.ws.WebServiceContext;
|
---|
16 | import org.apache.commons.logging.Log;
|
---|
17 | import org.apache.commons.logging.LogFactory;
|
---|
18 |
|
---|
19 | /**
|
---|
20 | *
|
---|
21 | * @author vvickers
|
---|
22 | */
|
---|
23 | class DocRetrieveImpl {
|
---|
24 |
|
---|
25 | private static Log log = LogFactory.getLog(DocRetrieveImpl.class);
|
---|
26 |
|
---|
27 | RetrieveDocumentSetResponseType respondingGatewayCrossGatewayRetrieve(RetrieveDocumentSetRequestType body, WebServiceContext context) {
|
---|
28 | log.debug("Entering DocRetrieveImpl.respondingGatewayCrossGatewayRetrieve");
|
---|
29 |
|
---|
30 | RetrieveDocumentSetResponseType resp = new RetrieveDocumentSetResponseType();
|
---|
31 |
|
---|
32 | RespondingGatewayCrossGatewayRetrieveRequestType crossGatewayRetrieveRequest = new RespondingGatewayCrossGatewayRetrieveRequestType();
|
---|
33 | crossGatewayRetrieveRequest.setRetrieveDocumentSetRequest(body);
|
---|
34 | crossGatewayRetrieveRequest.setAssertion(SamlTokenExtractor.GetAssertion(context));
|
---|
35 |
|
---|
36 | String homeCommunityId = SamlTokenExtractorHelper.getHomeCommunityId();
|
---|
37 |
|
---|
38 | NhincDocRetrieveService service = new NhincDocRetrieveService();
|
---|
39 | NhincDocRetrievePortType port = service.getNhincDocRetrievePortTypeBindingPort();
|
---|
40 | ((javax.xml.ws.BindingProvider) port).getRequestContext().put(javax.xml.ws.BindingProvider.ENDPOINT_ADDRESS_PROPERTY, SamlTokenExtractorHelper.getEndpointURL(homeCommunityId, SamlTokenExtractorHelper.INTERNAL_DOC_RETRIEVE));
|
---|
41 |
|
---|
42 | resp = port.respondingGatewayCrossGatewayRetrieve(crossGatewayRetrieveRequest);
|
---|
43 | log.debug("Exiting DocRetrieveImpl.respondingGatewayCrossGatewayRetrieve");
|
---|
44 | return resp;
|
---|
45 | }
|
---|
46 |
|
---|
47 | }
|
---|