use of org.w3.wsaddressing10.AttributedURIType in project webcert by sklintyg.
the class SendQuestionStubTest method answerWithMessageErrorGeneratesError.
@Test
public void answerWithMessageErrorGeneratesError() {
AttributedURIType address = new AttributedURIType();
address.setValue(SEND_QUESTION_STUB_ADDRESS);
SendMedicalCertificateQuestionType parameters = createQuestion("Error");
SendMedicalCertificateQuestionResponseType answer = stub.sendMedicalCertificateQuestion(address, parameters);
assertEquals(ResultCodeEnum.ERROR, answer.getResult().getResultCode());
}
use of org.w3.wsaddressing10.AttributedURIType in project webcert by sklintyg.
the class SendAnswerStubTest method answerWithMessageErrorGeneratesError.
@Test
public void answerWithMessageErrorGeneratesError() {
AttributedURIType address = new AttributedURIType();
address.setValue(SEND_ANSWER_STUB_ADDRESS);
SendMedicalCertificateAnswerType parameters = createAnswer("Error");
SendMedicalCertificateAnswerResponseType answer = stub.sendMedicalCertificateAnswer(address, parameters);
assertEquals(ResultCodeEnum.ERROR, answer.getResult().getResultCode());
}
use of org.w3.wsaddressing10.AttributedURIType in project webcert by sklintyg.
the class FragaSvarServiceImpl method sendFragaSvarToExternalParty.
private void sendFragaSvarToExternalParty(final FragaSvar fragaSvar) {
// Send to external party (FK)
SendMedicalCertificateAnswerType sendType = new SendMedicalCertificateAnswerType();
AnswerToFkType answer = FKAnswerConverter.convert(fragaSvar);
sendType.setAnswer(answer);
// Remove ASAP.
if ("true".equalsIgnoreCase(forceFullstandigtNamn)) {
answer.getLakarutlatande().getPatient().setFullstandigtNamn("---");
}
AttributedURIType logicalAddress = new AttributedURIType();
logicalAddress.setValue(sendAnswerToFkLogicalAddress);
SendMedicalCertificateAnswerResponseType response;
try {
response = sendAnswerToFKClient.sendMedicalCertificateAnswer(logicalAddress, sendType);
} catch (SOAPFaultException e) {
LOGGER.error("Failed to send answer to FK, error was: " + e.getMessage());
throw new WebCertServiceException(WebCertServiceErrorCodeEnum.EXTERNAL_SYSTEM_PROBLEM, e.getMessage());
}
if (!response.getResult().getResultCode().equals(ResultCodeEnum.OK)) {
LOGGER.error("Failed to send answer to FK, result was " + response.getResult().getErrorText());
throw new WebCertServiceException(WebCertServiceErrorCodeEnum.EXTERNAL_SYSTEM_PROBLEM, response.getResult().getErrorText());
}
monitoringService.logAnswerSent(fragaSvar.getExternReferens(), fragaSvar.getInternReferens(), (fragaSvar.getIntygsReferens() == null) ? null : fragaSvar.getIntygsReferens().getIntygsId(), fragaSvar.getVardAktorHsaId(), fragaSvar.getAmne());
// Notify stakeholders
sendNotification(fragaSvar, NotificationEvent.NEW_ANSWER_FROM_CARE);
}
Aggregations