Search in sources :

Example 16 with Phase4Exception

use of com.helger.phase4.util.Phase4Exception in project phase4 by phax.

the class Phase4PeppolServletMessageProcessorSPI method processAS4UserMessage.

@Nonnull
public AS4MessageProcessorResult processAS4UserMessage(@Nonnull final IAS4IncomingMessageMetadata aMessageMetadata, @Nonnull final HttpHeaderMap aHttpHeaders, @Nonnull final Ebms3UserMessage aUserMessage, @Nonnull final IPMode aSrcPMode, @Nullable final Node aPayload, @Nullable final ICommonsList<WSS4JAttachment> aIncomingAttachments, @Nonnull final IAS4MessageState aState, @Nonnull final ICommonsList<Ebms3Error> aProcessingErrorMessages) {
    if (LOGGER.isDebugEnabled())
        LOGGER.debug("Invoking processAS4UserMessage");
    final String sMessageID = aUserMessage.getMessageInfo().getMessageId();
    final String sService = aUserMessage.getCollaborationInfo().getServiceValue();
    final String sAction = aUserMessage.getCollaborationInfo().getAction();
    final String sConversationID = aUserMessage.getCollaborationInfo().getConversationId();
    final String sLogPrefix = "[" + sMessageID + "] ";
    final Locale aDisplayLocale = aState.getLocale();
    // Debug log
    if (LOGGER.isDebugEnabled()) {
        if (aSrcPMode == null)
            LOGGER.debug(sLogPrefix + "  No Source PMode present");
        else
            LOGGER.debug(sLogPrefix + "  Source PMode = " + aSrcPMode.getID());
        LOGGER.debug(sLogPrefix + "  AS4 Message ID = '" + sMessageID + "'");
        LOGGER.debug(sLogPrefix + "  AS4 Service = '" + sService + "'");
        LOGGER.debug(sLogPrefix + "  AS4 Action = '" + sAction + "'");
        LOGGER.debug(sLogPrefix + "  AS4 ConversationId = '" + sConversationID + "'");
        // Log source properties
        if (aUserMessage.getMessageProperties() != null && aUserMessage.getMessageProperties().hasPropertyEntries()) {
            LOGGER.debug(sLogPrefix + "  AS4 MessageProperties:");
            for (final Ebms3Property p : aUserMessage.getMessageProperties().getProperty()) LOGGER.debug(sLogPrefix + "    [" + p.getName() + "] = [" + p.getValue() + "]");
        } else
            LOGGER.debug(sLogPrefix + "  No AS4 Mesage Properties present");
        if (aPayload == null)
            LOGGER.debug(sLogPrefix + "  No SOAP Body Payload present");
        else
            LOGGER.debug(sLogPrefix + "  SOAP Body Payload = " + XMLWriter.getNodeAsString(aPayload));
    }
    // Read all attachments
    final ICommonsList<ReadAttachment> aReadAttachments = new CommonsArrayList<>();
    if (aIncomingAttachments != null) {
        int nAttachmentIndex = 0;
        for (final IAS4Attachment aIncomingAttachment : aIncomingAttachments) {
            final ReadAttachment a = new ReadAttachment();
            a.m_sID = aIncomingAttachment.getId();
            a.m_sMimeType = aIncomingAttachment.getMimeType();
            a.m_sUncompressedMimeType = aIncomingAttachment.getUncompressedMimeType();
            a.m_aCharset = aIncomingAttachment.getCharset();
            a.m_eCompressionMode = aIncomingAttachment.getCompressionMode();
            try (final InputStream aSIS = aIncomingAttachment.getSourceStream()) {
                final NonBlockingByteArrayOutputStream aBAOS = new NonBlockingByteArrayOutputStream();
                if (StreamHelper.copyInputStreamToOutputStreamAndCloseOS(aSIS, aBAOS).isSuccess()) {
                    a.m_aPayloadBytes = aBAOS.getBufferOrCopy();
                }
            } catch (final IOException | AS4DecompressException ex) {
            // Fall through
            }
            if (a.m_aPayloadBytes == null) {
                LOGGER.error(sLogPrefix + "Failed to decompress the payload");
                aProcessingErrorMessages.add(EEbmsError.EBMS_DECOMPRESSION_FAILURE.getAsEbms3Error(aDisplayLocale, aState.getMessageID()));
                return AS4MessageProcessorResult.createFailure(null);
            }
            // Read data as SBDH
            // Hint for production systems: this may take a huge amount of memory,
            // if the payload is large
            final ErrorList aSBDHErrors = new ErrorList();
            a.m_aSBDH = SBDHReader.standardBusinessDocument().setValidationEventHandler(new WrappedCollectingValidationEventHandler(aSBDHErrors)).read(a.m_aPayloadBytes);
            if (a.m_aSBDH == null) {
                if (aSBDHErrors.isEmpty()) {
                    final String sMsg = "Failed to read the provided SBDH document";
                    LOGGER.error(sLogPrefix + sMsg);
                    aProcessingErrorMessages.add(EEbmsError.EBMS_OTHER.getAsEbms3Error(aDisplayLocale, aState.getMessageID(), sMsg));
                } else {
                    for (final IError aError : aSBDHErrors) {
                        final String sMsg = "Peppol SBDH Issue: " + aError.getAsString(aDisplayLocale);
                        LOGGER.error(sLogPrefix + sMsg);
                        aProcessingErrorMessages.add(EEbmsError.EBMS_OTHER.getAsEbms3Error(aDisplayLocale, aState.getMessageID(), sMsg));
                    }
                }
                return AS4MessageProcessorResult.createFailure(null);
            }
            aReadAttachments.add(a);
            if (LOGGER.isDebugEnabled())
                LOGGER.debug(sLogPrefix + "AS4 Attachment " + nAttachmentIndex + " with ID [" + a.m_sID + "] uses [" + a.m_sMimeType + (a.m_sUncompressedMimeType == null ? null : " - uncompressed " + a.m_sUncompressedMimeType) + "] and [" + StringHelper.getToString(a.m_aCharset, "no charset") + "] and length is " + (a.m_aPayloadBytes == null ? "<error>" : Integer.toString(a.m_aPayloadBytes.length)) + " bytes" + (a.m_eCompressionMode == null ? "" : " of compressed payload"));
            nAttachmentIndex++;
        }
    }
    if (aReadAttachments.size() != 1) {
        // In Peppol there must be exactly one payload
        final String sMsg = "In Peppol exactly one payload attachment is expected. This request has " + aReadAttachments.size() + " attachments";
        LOGGER.error(sLogPrefix + sMsg);
        return AS4MessageProcessorResult.createFailure(sMsg);
    }
    // The one and only
    final ReadAttachment aReadAttachment = aReadAttachments.getFirst();
    // Extract Peppol values from SBD
    final PeppolSBDHDocument aPeppolSBD;
    try {
        if (LOGGER.isDebugEnabled())
            LOGGER.debug(sLogPrefix + "Now evaluating the SBDH against Peppol rules");
        final boolean bPerformValueChecks = Phase4PeppolServletConfiguration.isPerformSBDHValueChecks();
        aPeppolSBD = new PeppolSBDHDocumentReader(SimpleIdentifierFactory.INSTANCE).setPerformValueChecks(bPerformValueChecks).extractData(aReadAttachment.standardBusinessDocument());
        if (LOGGER.isDebugEnabled())
            LOGGER.debug(sLogPrefix + "The provided SBDH is valid according to Peppol rules, with value checks being " + (bPerformValueChecks ? "enabled" : "disabled"));
    } catch (final PeppolSBDHDocumentReadException ex) {
        final String sMsg = "Failed to extract the Peppol data from SBDH. Technical details: " + ex.getClass().getName() + " - " + ex.getMessage();
        LOGGER.error(sLogPrefix + sMsg);
        return AS4MessageProcessorResult.createFailure(sMsg);
    }
    if (m_aHandlers.isEmpty()) {
        LOGGER.error(sLogPrefix + "No SPI handler is present - the message is unhandled and discarded");
    } else {
        // Start consistency checks?
        final Phase4PeppolReceiverCheckData aReceiverCheckData = m_aReceiverCheckData != null ? m_aReceiverCheckData : Phase4PeppolServletConfiguration.getAsReceiverCheckData();
        if (aReceiverCheckData != null) {
            if (LOGGER.isDebugEnabled())
                LOGGER.debug("Performing check if the provided data is registered in our SMP");
            try {
                // Get the endpoint information required from the recipient
                // Check if an endpoint is registered
                final IParticipantIdentifier aReceiverID = aPeppolSBD.getReceiverAsIdentifier();
                final IDocumentTypeIdentifier aDocTypeID = aPeppolSBD.getDocumentTypeAsIdentifier();
                final IProcessIdentifier aProcessID = aPeppolSBD.getProcessAsIdentifier();
                final EndpointType aReceiverEndpoint = _getReceiverEndpoint(sLogPrefix, aReceiverCheckData.getSMPClient(), aReceiverID, aDocTypeID, aProcessID);
                if (aReceiverEndpoint == null) {
                    final String sMsg = "Failed to resolve SMP endpoint for provided receiver ID (" + (aReceiverID == null ? "null" : aReceiverID.getURIEncoded()) + ")/documentType ID (" + (aDocTypeID == null ? "null" : aDocTypeID.getURIEncoded()) + ")/process ID (" + (aProcessID == null ? "null" : aProcessID.getURIEncoded()) + ")/transport profile (" + m_aTransportProfile.getID() + ") - not handling incoming AS4 document";
                    LOGGER.error(sLogPrefix + sMsg);
                    return AS4MessageProcessorResult.createFailure(sMsg);
                }
                // Check if the message is for us
                _checkIfReceiverEndpointURLMatches(sLogPrefix, aReceiverCheckData.getAS4EndpointURL(), aReceiverEndpoint);
                // Get the recipient certificate from the SMP
                _checkIfEndpointCertificateMatches(sLogPrefix, aReceiverCheckData.getAPCertificate(), aReceiverEndpoint);
            } catch (final Phase4Exception ex) {
                final String sMsg = "The addressing data contained in the SBDH could not be verified. Technical details: " + ex.getClass().getName() + " - " + ex.getMessage();
                LOGGER.error(sLogPrefix + sMsg);
                return AS4MessageProcessorResult.createFailure(sMsg);
            }
        } else {
            LOGGER.info(sLogPrefix + "Endpoint checks for incoming AS4 messages are disabled");
        }
        for (final IPhase4PeppolIncomingSBDHandlerSPI aHandler : m_aHandlers) {
            try {
                if (LOGGER.isDebugEnabled())
                    LOGGER.debug(sLogPrefix + "Invoking Peppol handler " + aHandler);
                aHandler.handleIncomingSBD(aMessageMetadata, aHttpHeaders.getClone(), aUserMessage.clone(), aReadAttachment.payloadBytes(), aReadAttachment.standardBusinessDocument(), aPeppolSBD, aState);
            } catch (final Exception ex) {
                LOGGER.error(sLogPrefix + "Error invoking Peppol handler " + aHandler, ex);
                if (aHandler.exceptionTranslatesToAS4Error()) {
                    final String sMsg = "The incoming Peppol message could not be processed. Technical details: " + ex.getClass().getName() + " - " + ex.getMessage();
                    LOGGER.error(sLogPrefix + sMsg);
                    return AS4MessageProcessorResult.createFailure(sMsg);
                }
            }
        }
    }
    return AS4MessageProcessorResult.createSuccess();
}
Also used : Locale(java.util.Locale) AS4DecompressException(com.helger.phase4.attachment.AS4DecompressException) IAS4Attachment(com.helger.phase4.attachment.IAS4Attachment) WrappedCollectingValidationEventHandler(com.helger.jaxb.validation.WrappedCollectingValidationEventHandler) IDocumentTypeIdentifier(com.helger.peppolid.IDocumentTypeIdentifier) IProcessIdentifier(com.helger.peppolid.IProcessIdentifier) Phase4Exception(com.helger.phase4.util.Phase4Exception) EndpointType(com.helger.xsds.peppol.smp1.EndpointType) PeppolSBDHDocumentReadException(com.helger.peppol.sbdh.read.PeppolSBDHDocumentReadException) Ebms3Property(com.helger.phase4.ebms3header.Ebms3Property) PeppolSBDHDocument(com.helger.peppol.sbdh.PeppolSBDHDocument) InputStream(java.io.InputStream) NonBlockingByteArrayOutputStream(com.helger.commons.io.stream.NonBlockingByteArrayOutputStream) PeppolSBDHDocumentReader(com.helger.peppol.sbdh.read.PeppolSBDHDocumentReader) IOException(java.io.IOException) IError(com.helger.commons.error.IError) AS4DecompressException(com.helger.phase4.attachment.AS4DecompressException) PeppolSBDHDocumentReadException(com.helger.peppol.sbdh.read.PeppolSBDHDocumentReadException) Phase4Exception(com.helger.phase4.util.Phase4Exception) IOException(java.io.IOException) CertificateException(java.security.cert.CertificateException) ErrorList(com.helger.commons.error.list.ErrorList) CommonsArrayList(com.helger.commons.collection.impl.CommonsArrayList) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) Nonnull(javax.annotation.Nonnull)

Example 17 with Phase4Exception

use of com.helger.phase4.util.Phase4Exception in project peppol-practical by phax.

the class PageSecurePeppolSendAS4 method fillContent.

@Override
protected void fillContent(@Nonnull final WebPageExecutionContext aWPEC) {
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final IIdentifierFactory aIF = Phase4PeppolSender.IF;
    final FormErrorList aFormErrors = new FormErrorList();
    if (aWPEC.params().hasStringValue(CPageParam.PARAM_ACTION, CPageParam.ACTION_PERFORM)) {
        final String sSenderID = aWPEC.params().getAsStringTrimmed(FIELD_SENDER_ID);
        final IParticipantIdentifier aSenderID = aIF.parseParticipantIdentifier(sSenderID);
        final String sReceiverID = aWPEC.params().getAsStringTrimmed(FIELD_RECEIVER_ID);
        final IParticipantIdentifier aReceiverID = aIF.parseParticipantIdentifier(sReceiverID);
        final String sDocTypeID = aWPEC.params().getAsStringTrimmed(FIELD_DOCTYPE_ID);
        final IDocumentTypeIdentifier aDocTypeID = aIF.parseDocumentTypeIdentifier(sDocTypeID);
        final String sProcessID = aWPEC.params().getAsStringTrimmed(FIELD_PROCESS_ID);
        final IProcessIdentifier aProcessID = aIF.parseProcessIdentifier(sProcessID);
        final String sPayload = aWPEC.params().getAsStringTrimmed(FIELD_PAYLOAD);
        final Document aPayloadDoc = DOMReader.readXMLDOM(sPayload);
        if (StringHelper.hasNoText(sSenderID))
            aFormErrors.addFieldError(FIELD_SENDER_ID, "A sending participant ID must be provided.");
        else if (aSenderID == null)
            aFormErrors.addFieldError(FIELD_SENDER_ID, "The sending participant ID could not be parsed.");
        if (StringHelper.hasNoText(sReceiverID))
            aFormErrors.addFieldError(FIELD_RECEIVER_ID, "A receiving participant ID must be provided.");
        else if (aReceiverID == null)
            aFormErrors.addFieldError(FIELD_RECEIVER_ID, "The receiving participant ID could not be parsed.");
        if (StringHelper.hasNoText(sDocTypeID))
            aFormErrors.addFieldError(FIELD_DOCTYPE_ID, "A document type ID must be provided.");
        else if (aDocTypeID == null)
            aFormErrors.addFieldError(FIELD_DOCTYPE_ID, "The document type ID could not be parsed.");
        if (StringHelper.hasNoText(sProcessID))
            aFormErrors.addFieldError(FIELD_PROCESS_ID, "A process ID must be provided.");
        else if (aProcessID == null)
            aFormErrors.addFieldError(FIELD_PROCESS_ID, "The process ID could not be parsed.");
        if (StringHelper.hasNoText(sPayload))
            aFormErrors.addFieldError(FIELD_PAYLOAD, "A payload must be provided.");
        else if (aPayloadDoc == null)
            aFormErrors.addFieldError(FIELD_PAYLOAD, "The payload is not wellformed XML.");
        if (aFormErrors.isEmpty()) {
            final HCDiv aNL = new HCDiv().addStyle(CCSSProperties.MAX_WIDTH.newValue("80vw"));
            final String sAS4PayloadDoc = XMLWriter.getNodeAsString(aPayloadDoc);
            final byte[] aAS4PayloadBytes = XMLWriter.getNodeAsBytes(aPayloadDoc);
            aNL.addChild(h3("Sending document"));
            // Show payload
            aNL.addChild(new BootstrapPrismJS(EPrismLanguage.MARKUP).addPlugin(new PrismPluginLineNumbers()).addChild(sAS4PayloadDoc));
            final IAS4ClientBuildMessageCallback aBuildMessageCallback = new IAS4ClientBuildMessageCallback() {

                public void onAS4Message(final AbstractAS4Message<?> aMsg) {
                    final AS4UserMessage aUserMsg = (AS4UserMessage) aMsg;
                    LOGGER.info("Sending out AS4 message with message ID '" + aUserMsg.getEbms3UserMessage().getMessageInfo().getMessageId() + "'");
                }
            };
            try {
                final SMPClientReadOnly aSMPClient = new SMPClientReadOnly(Phase4PeppolSender.URL_PROVIDER, aReceiverID, ESML.DIGIT_TEST);
                // What to remember
                final Wrapper<String> aEndpointURL = new Wrapper<>();
                final Wrapper<X509Certificate> aEndpointCert = new Wrapper<>();
                final Wrapper<EPeppolCertificateCheckResult> aEndpointCertCheck = new Wrapper<>();
                final Wrapper<Phase4Exception> aSendEx = new Wrapper<>();
                final Wrapper<byte[]> aResponseBytes = new Wrapper<>();
                final Wrapper<Ebms3SignalMessage> aResponseMsg = new Wrapper<>();
                LOGGER.info("Sending Peppol AS4 message from '" + aSenderID.getURIEncoded() + "' to '" + aReceiverID.getURIEncoded() + "' using document type '" + aDocTypeID.getURIEncoded() + "' and process ID '" + aProcessID.getURIEncoded() + "'");
                // Try to send message
                final ESimpleUserMessageSendResult eResult = Phase4PeppolSender.builder().cryptoFactory(AS4_CF).documentTypeID(aDocTypeID).processID(aProcessID).senderParticipantID(aSenderID).receiverParticipantID(aReceiverID).senderPartyID("POP000306").payload(aAS4PayloadBytes).smpClient(aSMPClient).endpointURLConsumer(aEndpointURL::set).certificateConsumer((cert, dt, res) -> {
                    aEndpointCert.set(cert);
                    aEndpointCertCheck.set(res);
                }).validationConfiguration(null).buildMessageCallback(aBuildMessageCallback).outgoingDumper(new AS4OutgoingDumperFileBased()).incomingDumper(new AS4IncomingDumperFileBased()).rawResponseConsumer(r -> aResponseBytes.set(r.getResponse())).signalMsgConsumer(aResponseMsg::set).sendMessageAndCheckForReceipt(aSendEx::set);
                LOGGER.info("Sending Peppol AS4 message resulted in " + eResult);
                if (aEndpointURL.isSet())
                    aNL.addChild(div("Sending to this endpoint URL: ").addChild(code(aEndpointURL.get())));
                if (aEndpointCert.isSet())
                    aNL.addChild(div("The message is encrypted for the following receiver: ").addChild(code(aEndpointCert.get().getSubjectX500Principal().getName())));
                if (aEndpointCertCheck.isSet())
                    aNL.addChild(div("The certificate verification resulted in: ").addChild(code(aEndpointCertCheck.get().name())));
                if (eResult.isSuccess())
                    aNL.addChild(success("Successfully send AS4 message to Peppol receiver ").addChild(code(aReceiverID.getURIEncoded())));
                else
                    aNL.addChild(error().addChild(div("Failed to send AS4 message to Peppol receiver ").addChild(code(aReceiverID.getURIEncoded())).addChild(" with result ").addChild(code(eResult.name()))).addChild(AppCommonUI.getTechnicalDetailsUI(aSendEx.get(), true)));
                boolean bShowRaw = true;
                if (aResponseMsg.isSet()) {
                    // Don't do XSD validation here because there is no defined
                    // "SignalMessage" element
                    final String sSignalMessage = new GenericJAXBMarshaller<>(Ebms3SignalMessage.class, GenericJAXBMarshaller.createSimpleJAXBElement(new QName(com.helger.phase4.ebms3header.ObjectFactory._Messaging_QNAME.getNamespaceURI(), "SignalMessage"), Ebms3SignalMessage.class)).setFormattedOutput(true).getAsString(aResponseMsg.get());
                    if (StringHelper.hasText(sSignalMessage)) {
                        // Show payload
                        aNL.addChild(div("Response ebMS Signal Message"));
                        aNL.addChild(new BootstrapPrismJS(EPrismLanguage.MARKUP).addPlugin(new PrismPluginLineNumbers()).addChild(sSignalMessage));
                        bShowRaw = false;
                    }
                }
                if (aResponseBytes.isSet()) {
                    if (bShowRaw) {
                        aNL.addChild(div("Response message - NOT a valid response"));
                        aNL.addChild(new BootstrapPrismJS(EPrismLanguage.MARKUP).addPlugin(new PrismPluginLineNumbers()).addChild(new String(aResponseBytes.get(), StandardCharsets.UTF_8)));
                    }
                // Else already shown above
                } else {
                    if (eResult.isSuccess())
                        aNL.addChild(error("Received no response content :("));
                }
            } catch (final SMPDNSResolutionException ex) {
                aNL.addChild(error(div("Error creating the SMP client.")).addChild(AppCommonUI.getTechnicalDetailsUI(ex, false)));
            }
            if (true)
                aNodeList.addChild(aNL);
            else
                aWPEC.postRedirectGetInternal(aNL);
        }
    }
    aNodeList.addChild(h3("Send new Peppol AS4 message (Test network only)"));
    final BootstrapForm aForm = aNodeList.addAndReturnChild(new BootstrapForm(aWPEC));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Sending participant ID").setCtrl(new HCEdit(new RequestField(FIELD_SENDER_ID, DEFAULT_SENDER_ID))).setHelpText(span("The sending Peppol participant identifier. Must include the ").addChild(code(PeppolIdentifierHelper.DEFAULT_PARTICIPANT_SCHEME)).addChild(" prefix.")).setErrorList(aFormErrors.getListOfField(FIELD_SENDER_ID)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Receiving participant ID").setCtrl(new HCEdit(new RequestField(FIELD_RECEIVER_ID, DEFAULT_RECEIVER_ID))).setHelpText(span("The receiving Peppol participant identifier. Must include the ").addChild(code(PeppolIdentifierHelper.DEFAULT_PARTICIPANT_SCHEME)).addChild(" prefix.")).setErrorList(aFormErrors.getListOfField(FIELD_RECEIVER_ID)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Document type ID").setCtrl(new HCEdit(new RequestField(FIELD_DOCTYPE_ID, DEFAULT_DOCTYPE_ID))).setHelpText(span("The Peppol document type identifier. Must include the ").addChild(code(PeppolIdentifierHelper.DOCUMENT_TYPE_SCHEME_BUSDOX_DOCID_QNS)).addChild(" prefix.")).setErrorList(aFormErrors.getListOfField(FIELD_DOCTYPE_ID)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Process ID").setCtrl(new HCEdit(new RequestField(FIELD_PROCESS_ID, DEFAULT_PROCESS_ID))).setHelpText(span("The Peppol process identifier. Must include the ").addChild(code(PeppolIdentifierHelper.DEFAULT_PROCESS_SCHEME)).addChild(" prefix.")).setErrorList(aFormErrors.getListOfField(FIELD_PROCESS_ID)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("XML Payload to be send").setCtrl(new HCTextArea(new RequestField(FIELD_PAYLOAD, DEFAULT_PAYLOAD.get())).setRows(8)).setHelpText("This MUST be wellformed XML - e.g. a UBL Invoice or a CII Invoice. NO Schematron validation is performed. The SBDH is added automatically.").setErrorList(aFormErrors.getListOfField(FIELD_PAYLOAD)));
    aForm.addChild(new HCHiddenField(CPageParam.PARAM_ACTION, CPageParam.ACTION_PERFORM));
    aForm.addChild(new BootstrapSubmitButton().addChild("Send Peppol AS4 message"));
}
Also used : HCDiv(com.helger.html.hc.html.grouping.HCDiv) Ebms3SignalMessage(com.helger.phase4.ebms3header.Ebms3SignalMessage) X509Certificate(java.security.cert.X509Certificate) AppConfig(com.helger.peppol.app.AppConfig) WebPageExecutionContext(com.helger.photon.uicore.page.WebPageExecutionContext) PeppolIdentifierHelper(com.helger.peppolid.peppol.PeppolIdentifierHelper) IDocumentTypeIdentifier(com.helger.peppolid.IDocumentTypeIdentifier) BootstrapSubmitButton(com.helger.photon.bootstrap4.button.BootstrapSubmitButton) LoggerFactory(org.slf4j.LoggerFactory) HCHiddenField(com.helger.html.hc.html.forms.HCHiddenField) CCSSProperties(com.helger.css.property.CCSSProperties) IKeyStoreType(com.helger.security.keystore.IKeyStoreType) FormErrorList(com.helger.photon.core.form.FormErrorList) BootstrapForm(com.helger.photon.bootstrap4.form.BootstrapForm) Phase4PeppolSender(com.helger.phase4.peppol.Phase4PeppolSender) IIdentifierFactory(com.helger.peppolid.factory.IIdentifierFactory) PrivateKeyEntry(java.security.KeyStore.PrivateKeyEntry) Document(org.w3c.dom.Document) HCTextArea(com.helger.html.hc.html.forms.HCTextArea) CPageParam(com.helger.photon.uicore.css.CPageParam) ESML(com.helger.peppol.sml.ESML) HCDiv(com.helger.html.hc.html.grouping.HCDiv) EPeppolCertificateCheckResult(com.helger.peppol.utils.EPeppolCertificateCheckResult) KeyStoreHelper(com.helger.security.keystore.KeyStoreHelper) LoadedKeyStore(com.helger.security.keystore.LoadedKeyStore) AS4OutgoingDumperFileBased(com.helger.phase4.dump.AS4OutgoingDumperFileBased) StandardCharsets(java.nio.charset.StandardCharsets) EPredefinedProcessIdentifier(com.helger.peppolid.peppol.process.EPredefinedProcessIdentifier) DOMReader(com.helger.xml.serialize.read.DOMReader) EKeyStoreType(com.helger.security.keystore.EKeyStoreType) AbstractAS4Message(com.helger.phase4.messaging.domain.AbstractAS4Message) IValidityIndicator(com.helger.commons.state.IValidityIndicator) QName(javax.xml.namespace.QName) AppCommonUI(com.helger.peppol.ui.AppCommonUI) PrismPluginLineNumbers(com.helger.photon.uictrls.prism.PrismPluginLineNumbers) Ebms3SignalMessage(com.helger.phase4.ebms3header.Ebms3SignalMessage) EPredefinedDocumentTypeIdentifier(com.helger.peppolid.peppol.doctype.EPredefinedDocumentTypeIdentifier) SMPClientReadOnly(com.helger.smpclient.peppol.SMPClientReadOnly) EValidity(com.helger.commons.state.EValidity) IAS4CryptoFactory(com.helger.phase4.crypto.IAS4CryptoFactory) SMPDNSResolutionException(com.helger.smpclient.url.SMPDNSResolutionException) HCEdit(com.helger.html.hc.html.forms.HCEdit) Supplier(java.util.function.Supplier) IProcessIdentifier(com.helger.peppolid.IProcessIdentifier) IConfig(com.helger.config.IConfig) LoadedKey(com.helger.security.keystore.LoadedKey) AS4CryptoFactoryInMemoryKeyStore(com.helger.phase4.crypto.AS4CryptoFactoryInMemoryKeyStore) ESimpleUserMessageSendResult(com.helger.phase4.sender.AbstractAS4UserMessageBuilder.ESimpleUserMessageSendResult) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) Nonnull(javax.annotation.Nonnull) Phase4Exception(com.helger.phase4.util.Phase4Exception) HCNodeList(com.helger.html.hc.impl.HCNodeList) AS4IncomingDumperFileBased(com.helger.phase4.dump.AS4IncomingDumperFileBased) AbstractBootstrapWebPage(com.helger.photon.bootstrap4.pages.AbstractBootstrapWebPage) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup) Logger(org.slf4j.Logger) StringHelper(com.helger.commons.string.StringHelper) BootstrapPrismJS(com.helger.photon.bootstrap4.uictrls.prism.BootstrapPrismJS) XMLWriter(com.helger.xml.serialize.write.XMLWriter) RequestField(com.helger.photon.core.form.RequestField) IAS4ClientBuildMessageCallback(com.helger.phase4.client.IAS4ClientBuildMessageCallback) Wrapper(com.helger.commons.wrapper.Wrapper) AS4UserMessage(com.helger.phase4.messaging.domain.AS4UserMessage) EPrismLanguage(com.helger.photon.uictrls.prism.EPrismLanguage) GenericJAXBMarshaller(com.helger.jaxb.GenericJAXBMarshaller) PrismPluginLineNumbers(com.helger.photon.uictrls.prism.PrismPluginLineNumbers) IAS4ClientBuildMessageCallback(com.helger.phase4.client.IAS4ClientBuildMessageCallback) SMPClientReadOnly(com.helger.smpclient.peppol.SMPClientReadOnly) HCNodeList(com.helger.html.hc.impl.HCNodeList) FormErrorList(com.helger.photon.core.form.FormErrorList) BootstrapPrismJS(com.helger.photon.bootstrap4.uictrls.prism.BootstrapPrismJS) HCEdit(com.helger.html.hc.html.forms.HCEdit) IDocumentTypeIdentifier(com.helger.peppolid.IDocumentTypeIdentifier) Document(org.w3c.dom.Document) GenericJAXBMarshaller(com.helger.jaxb.GenericJAXBMarshaller) IProcessIdentifier(com.helger.peppolid.IProcessIdentifier) AbstractAS4Message(com.helger.phase4.messaging.domain.AbstractAS4Message) Phase4Exception(com.helger.phase4.util.Phase4Exception) AS4IncomingDumperFileBased(com.helger.phase4.dump.AS4IncomingDumperFileBased) IIdentifierFactory(com.helger.peppolid.factory.IIdentifierFactory) AS4OutgoingDumperFileBased(com.helger.phase4.dump.AS4OutgoingDumperFileBased) RequestField(com.helger.photon.core.form.RequestField) Wrapper(com.helger.commons.wrapper.Wrapper) EPeppolCertificateCheckResult(com.helger.peppol.utils.EPeppolCertificateCheckResult) HCTextArea(com.helger.html.hc.html.forms.HCTextArea) HCHiddenField(com.helger.html.hc.html.forms.HCHiddenField) QName(javax.xml.namespace.QName) AS4UserMessage(com.helger.phase4.messaging.domain.AS4UserMessage) X509Certificate(java.security.cert.X509Certificate) BootstrapForm(com.helger.photon.bootstrap4.form.BootstrapForm) ESimpleUserMessageSendResult(com.helger.phase4.sender.AbstractAS4UserMessageBuilder.ESimpleUserMessageSendResult) BootstrapSubmitButton(com.helger.photon.bootstrap4.button.BootstrapSubmitButton) SMPDNSResolutionException(com.helger.smpclient.url.SMPDNSResolutionException) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier)

Aggregations

Phase4Exception (com.helger.phase4.util.Phase4Exception)15 IOException (java.io.IOException)10 Ebms3SignalMessage (com.helger.phase4.ebms3header.Ebms3SignalMessage)9 Ebms3UserMessage (com.helger.phase4.ebms3header.Ebms3UserMessage)8 Nonnull (javax.annotation.Nonnull)8 Nullable (javax.annotation.Nullable)8 MessagingException (javax.mail.MessagingException)8 WSSecurityException (org.apache.wss4j.common.ext.WSSecurityException)8 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)7 WSS4JAttachment (com.helger.phase4.attachment.WSS4JAttachment)7 ICommonsList (com.helger.commons.collection.impl.ICommonsList)6 HttpHeaderMap (com.helger.commons.http.HttpHeaderMap)6 Wrapper (com.helger.commons.wrapper.Wrapper)6 AS4DecompressException (com.helger.phase4.attachment.AS4DecompressException)6 Ebms3Property (com.helger.phase4.ebms3header.Ebms3Property)6 IPMode (com.helger.phase4.model.pmode.IPMode)6 Locale (java.util.Locale)6 Logger (org.slf4j.Logger)6 LoggerFactory (org.slf4j.LoggerFactory)6 Document (org.w3c.dom.Document)6