ReceiptExternal response;
try {
response = port.insertCorrespondenceBasicV2(settings.getSystemUserName(), settings.getSystemPassword(), settings.getSystemUserCode(), msg.getExternalReference(), request);
if (!ReceiptStatusEnum.OK.equals(response.getReceiptStatusCode()))
throw new AltinnException("Status was not ok: receiptID " + response.getReceiptId() + " status " + response.getReceiptStatusCode());
} catch (ICorrespondenceAgencyExternalBasicInsertCorrespondenceBasicV2AltinnFaultFaultFaultMessage e) {
throw new AltinnException(getAltinnFaultMessage(e), e);
}
return response.getReceiptId();
}