source: ccr/trunk/nhin-vista/projects/NHINC/Current/Product/Production/Gateway/NhincDocQueryEJB/src/java/gov/hhs/fha/nhinc/docquery/DocQueryImpl.java@ 507

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: 2.0 KB
Line 
1/*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5
6package gov.hhs.fha.nhinc.docquery;
7
8import gov.hhs.fha.nhinc.common.nhinccommoninternalorch.RespondingGatewayCrossGatewayQueryRequestType;
9import gov.hhs.fha.nhinc.nhincdocquery.NhincDocQueryPortType;
10import gov.hhs.fha.nhinc.nhincdocquery.NhincDocQueryService;
11import gov.hhs.fha.nhinc.saml.extraction.SamlTokenExtractor;
12import gov.hhs.fha.nhinc.saml.extraction.SamlTokenExtractorHelper;
13import javax.xml.ws.WebServiceContext;
14import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryRequest;
15import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryResponse;
16import org.apache.commons.logging.Log;
17import org.apache.commons.logging.LogFactory;
18
19/**
20 *
21 * @author vvickers
22 */
23class 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}
Note: See TracBrowser for help on using the repository browser.