Source:
public MCCIIN000002UV01 respondingGatewayPRPAIN201305UV02(PRPAIN201305UV02 request, AssertionType assertion, NhinTargetSystemType target) { String url; String ackMessage; MCCIIN000002UV01 response = new MCCIIN000002UV01(); try { if (request != null) { LOG.debug("Before target system URL look up."); url = oProxyHelper.getUrlFromTargetSystemByGatewayAPILevel(target, NhincConstants.PATIENT_DISCOVERY_DEFERRED_REQ_SERVICE_NAME, GATEWAY_API_LEVEL.LEVEL_g0); LOG.debug("After target system URL look up. URL for service: " + NhincConstants.PATIENT_DISCOVERY_DEFERRED_REQ_SERVICE_NAME + " is: " + url); if (NullChecker.isNotNullish(url)) { ServicePortDescriptor<RespondingGatewayDeferredRequestPortType> portDescriptor = new RespondingGatewayDeferredRequestServicePortDescriptor(); CONNECTClient<RespondingGatewayDeferredRequestPortType> client = getCONNECTSecuredClient( portDescriptor, assertion, url, target); response = (MCCIIN000002UV01) client.invokePort(RespondingGatewayDeferredRequestPortType.class, "respondingGatewayDeferredPRPAIN201305UV02", request); } else { throw new WebServiceException("Could not determine URL for Patient Discovery Deferred Request endpoint"); } } else { throw new IllegalArgumentException("Request Message must be provided"); } } catch (Exception e) { ackMessage = "Failed to call the web service (" + NhincConstants.PATIENT_DISCOVERY_DEFERRED_REQ_SERVICE_NAME + "). An unexpected exception occurred."; response = HL7AckTransforms.createAckErrorFrom201305(request, ackMessage); LOG.error(ackMessage + " Exception: " + e.getMessage(), e); throw new ErrorEventException(e, response, "Unable to call Nhin Patient Discovery Deferred Request"); } return response; }

Target:
public MCCIIN000002UV01 respondingGatewayPRPAIN201305UV02(PRPAIN201305UV02 request, AssertionType assertion, NhinTargetSystemType target) { String url; String ackMessage; MCCIIN000002UV01 response = new MCCIIN000002UV01(); try { if (request != null) { LOG.debug("Before target system URL look up."); url = oProxyHelper.getUrlFromTargetSystemByGatewayAPILevel(target, NhincConstants.PATIENT_DISCOVERY_DEFERRED_REQ_SERVICE_NAME, GATEWAY_API_LEVEL.LEVEL_g0); LOG.debug("After target system URL look up. URL for service: is: {}", NhincConstants.PATIENT_DISCOVERY_DEFERRED_REQ_SERVICE_NAME, url); if (NullChecker.isNotNullish(url)) { ServicePortDescriptor<RespondingGatewayDeferredRequestPortType> portDescriptor = new RespondingGatewayDeferredRequestServicePortDescriptor(); CONNECTClient<RespondingGatewayDeferredRequestPortType> client = getCONNECTSecuredClient( portDescriptor, assertion, url, target); response = (MCCIIN000002UV01) client.invokePort(RespondingGatewayDeferredRequestPortType.class, "respondingGatewayDeferredPRPAIN201305UV02", request); } else { throw new WebServiceException("Could not determine URL for Patient Discovery Deferred Request endpoint"); } } else { throw new IllegalArgumentException("Request Message must be provided"); } } catch (Exception e) { ackMessage = "Failed to call the web service (" + NhincConstants.PATIENT_DISCOVERY_DEFERRED_REQ_SERVICE_NAME + "). An unexpected exception occurred."; response = HL7AckTransforms.createAckErrorFrom201305(request, ackMessage); throw new ErrorEventException(e, response, "Unable to call Nhin Patient Discovery Deferred Request"); } return response; }