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.docquery;
|
---|
7 |
|
---|
8 | import gov.hhs.fha.nhinc.common.nhinccommoninternalorch.RespondingGatewayCrossGatewayQueryRequestType;
|
---|
9 | import gov.hhs.fha.nhinc.nhincdocquery.NhincDocQueryPortType;
|
---|
10 | import gov.hhs.fha.nhinc.nhincdocquery.NhincDocQueryService;
|
---|
11 | import gov.hhs.fha.nhinc.saml.extraction.SamlTokenExtractor;
|
---|
12 | import gov.hhs.fha.nhinc.saml.extraction.SamlTokenExtractorHelper;
|
---|
13 | import javax.xml.ws.WebServiceContext;
|
---|
14 | import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryRequest;
|
---|
15 | import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryResponse;
|
---|
16 | import org.apache.commons.logging.Log;
|
---|
17 | import org.apache.commons.logging.LogFactory;
|
---|
18 |
|
---|
19 | /**
|
---|
20 | *
|
---|
21 | * @author vvickers
|
---|
22 | */
|
---|
23 | class DocQueryImpl {
|
---|
24 |
|
---|
25 | private static Log log = LogFactory.getLog(DocQueryImpl.class);
|
---|
26 |
|
---|
27 | AdhocQueryResponse respondingGatewayCrossGatewayQuery(AdhocQueryRequest body, WebServiceContext context) {
|
---|
28 | log.debug("Entering DocQueryImpl.respondingGatewayCrossGatewayQuery");
|
---|
29 |
|
---|
30 | AdhocQueryResponse resp = new AdhocQueryResponse();
|
---|
31 |
|
---|
32 | RespondingGatewayCrossGatewayQueryRequestType crossGatewayQueryRequest = new RespondingGatewayCrossGatewayQueryRequestType();
|
---|
33 | crossGatewayQueryRequest.setAdhocQueryRequest(body);
|
---|
34 | crossGatewayQueryRequest.setAssertion(SamlTokenExtractor.GetAssertion(context));
|
---|
35 |
|
---|
36 | String homeCommunityId = SamlTokenExtractorHelper.getHomeCommunityId();
|
---|
37 |
|
---|
38 | NhincDocQueryService service = new NhincDocQueryService();
|
---|
39 | NhincDocQueryPortType port = service.getNhincDocQueryPortTypeBindingPort();
|
---|
40 | ((javax.xml.ws.BindingProvider) port).getRequestContext().put(javax.xml.ws.BindingProvider.ENDPOINT_ADDRESS_PROPERTY, SamlTokenExtractorHelper.getEndpointURL(homeCommunityId, SamlTokenExtractorHelper.INTERNAL_DOC_QUERY));
|
---|
41 |
|
---|
42 | resp = port.respondingGatewayCrossGatewayQuery(crossGatewayQueryRequest);
|
---|
43 | log.debug("Exiting DocQueryImpl.respondingGatewayCrossGatewayQuery");
|
---|
44 | return resp;
|
---|
45 | }
|
---|
46 | }
|
---|