@Override protected void configureInterceptors(ServerFactoryBean svrFactory) { super.configureInterceptors(svrFactory); // install auditing-related interceptors if the user has not switched auditing off if (auditStrategy != null) { if (wsTransactionConfiguration.isAuditRequestPayload()) { svrFactory.getInInterceptors().add(new InPayloadExtractorInterceptor(SOAP_BODY)); } AuditResponseInterceptor<AuditDatasetType> auditInterceptor = new AuditResponseInterceptor<>(auditStrategy, auditContext,false, correlator, true); svrFactory.getInInterceptors().add(auditInterceptor); svrFactory.getInFaultInterceptors().add(auditInterceptor); } } }
protected void configureInterceptors(ServerFactoryBean svrFactory) { super.configureInterceptors(svrFactory); // install auditing-related interceptors if the user has not switched auditing off if (auditStrategy != null) { if (wsTransactionConfiguration.isAuditRequestPayload()) { svrFactory.getInInterceptors().add(new InPayloadExtractorInterceptor(SOAP_BODY)); } svrFactory.getInInterceptors().add(new AuditInRequestInterceptor<>( auditStrategy, auditContext, wsTransactionConfiguration)); AuditResponseInterceptor<AuditDatasetType> auditInterceptor = new AuditResponseInterceptor<>(auditStrategy, auditContext, true, null, false); svrFactory.getOutInterceptors().add(auditInterceptor); svrFactory.getOutFaultInterceptors().add(auditInterceptor); } }
@Override protected void configureInterceptors(Client client) { super.configureInterceptors(client); // install auditing-related interceptors if the user has not switched auditing off if (auditStrategy != null) { if (wsTransactionConfiguration.isAuditRequestPayload()) { installPayloadInterceptors(client); } client.getOutInterceptors().add(new AuditOutRequestInterceptor<>( auditStrategy, auditContext, correlator, getWsTransactionConfiguration())); AuditResponseInterceptor<AuditDatasetType> auditInterceptor = new AuditResponseInterceptor<>(auditStrategy, auditContext, false, correlator, false); client.getInInterceptors().add(auditInterceptor); client.getInFaultInterceptors().add(auditInterceptor); } } }
@Override protected void process(SoapMessage message) { if (isGET(message)) { return; } T auditDataset = getAuditDataset(message); extractAddressesFromServletRequest(message, auditDataset); enrichAuditDatasetFromXuaToken(message, Header.Direction.DIRECTION_IN, auditDataset); // TODO Also extract basic auth user? extractClientCertificateCommonName(message, auditDataset); if (wsTransactionConfiguration.isAuditRequestPayload()) { auditDataset.setRequestPayload(message.getContent(StringPayloadHolder.class)); } getAuditStrategy().enrichAuditDatasetFromRequest(auditDataset, extractPojo(message), message); }
@Override protected void process(SoapMessage message) { if (isGET(message)) { return; } T auditDataset = getAuditDataset(message); auditDataset.setRemoteAddress((String) message.get(Message.ENDPOINT_ADDRESS)); auditDataset.setDestinationUserId((String) message.get(Message.ENDPOINT_ADDRESS)); enrichAuditDatasetFromXuaToken(message, Header.Direction.DIRECTION_OUT, auditDataset); Object request = extractPojo(message); // Get request payload, handle different variants thereby: // a) for HL7v3-based transactions, payload corresponds to the "main" message; // b) for ebXML-based transactions, rely on the {@link OutPayloadExtractorInterceptor}. if (wsTransactionConfiguration.isAuditRequestPayload()) { if (request instanceof String) { auditDataset.setRequestPayload((String) request); } else { auditDataset.setRequestPayload(message.getContent(StringPayloadHolder.class)); } } getAuditStrategy().enrichAuditDatasetFromRequest(auditDataset, request, message); // when the invocation is asynchronous: store audit dataset into the correlator AddressingProperties props = (AddressingProperties) message.get(JAXWSAConstants.ADDRESSING_PROPERTIES_OUTBOUND); if (props != null && (Boolean.TRUE.equals(message.getContextualProperty(AsynchronyCorrelator.FORCE_CORRELATION)) || ! Names.WSA_ANONYMOUS_ADDRESS.equals(props.getReplyTo().getAddress().getValue()))) { correlator.storeAuditDataset(props.getMessageID().getValue(), auditDataset); } }