Search in sources :

Example 36 with ESoapVersion

use of com.helger.phase4.soap.ESoapVersion in project phase4 by phax.

the class MockPModeGenerator method ensureMockPModesArePresent.

public static void ensureMockPModesArePresent() {
    // Delete all in the correct order
    final IPModeManager aPModeMgr = MetaAS4Manager.getPModeMgr();
    for (final String sID : aPModeMgr.getAllIDs()) aPModeMgr.deletePMode(sID);
    // Create new one
    DefaultPMode.getOrCreateDefaultPMode(SOAP_11_PARTY_ID, SOAP_11_PARTY_ID, "http://test.mock11.org", true);
    DefaultPMode.getOrCreateDefaultPMode(SOAP_12_PARTY_ID, SOAP_12_PARTY_ID, "http://test.mock12.org", true);
    for (final ESoapVersion e : ESoapVersion.values()) aPModeMgr.createOrUpdatePMode(MockPModeGenerator.getTestPModeWithSecurity(e));
}
Also used : IPModeManager(com.helger.phase4.model.pmode.IPModeManager) ESoapVersion(com.helger.phase4.soap.ESoapVersion)

Example 37 with ESoapVersion

use of com.helger.phase4.soap.ESoapVersion in project phase4 by phax.

the class MockMessages method testUserMessageNotSignedNotPModeConform.

@Nonnull
public static Document testUserMessageNotSignedNotPModeConform(@Nonnull final ESoapVersion eSOAPVersion, @Nullable final Node aPayload, @Nullable final ICommonsList<WSS4JAttachment> aAttachments) {
    // Add properties
    final ICommonsList<Ebms3Property> aEbms3Properties = AS4TestConstants.getEBMSProperties();
    final String sPModeID = CAS4.DEFAULT_INITIATOR_URL + "-" + CAS4.DEFAULT_RESPONDER_URL;
    final Ebms3MessageInfo aEbms3MessageInfo = MessageHelperMethods.createEbms3MessageInfo();
    final Ebms3PayloadInfo aEbms3PayloadInfo = MessageHelperMethods.createEbms3PayloadInfo(aPayload != null, aAttachments);
    final Ebms3CollaborationInfo aEbms3CollaborationInfo = MessageHelperMethods.createEbms3CollaborationInfo(sPModeID + "x", DEFAULT_AGREEMENT, AS4TestConstants.TEST_SERVICE_TYPE, AS4TestConstants.TEST_SERVICE, MockMessageProcessorCheckingStreamsSPI.ACTION_FAILURE, AS4TestConstants.TEST_CONVERSATION_ID);
    final Ebms3PartyInfo aEbms3PartyInfo = MessageHelperMethods.createEbms3PartyInfo(CAS4.DEFAULT_INITIATOR_URL, "testt", CAS4.DEFAULT_RESPONDER_URL, "testt");
    final Ebms3MessageProperties aEbms3MessageProperties = MessageHelperMethods.createEbms3MessageProperties(aEbms3Properties);
    final AS4UserMessage aDoc = AS4UserMessage.create(aEbms3MessageInfo, aEbms3PayloadInfo, aEbms3CollaborationInfo, aEbms3PartyInfo, aEbms3MessageProperties, eSOAPVersion).setMustUnderstand(true);
    return aDoc.getAsSoapDocument(aPayload);
}
Also used : Ebms3MessageProperties(com.helger.phase4.ebms3header.Ebms3MessageProperties) Ebms3PayloadInfo(com.helger.phase4.ebms3header.Ebms3PayloadInfo) Ebms3CollaborationInfo(com.helger.phase4.ebms3header.Ebms3CollaborationInfo) Ebms3MessageInfo(com.helger.phase4.ebms3header.Ebms3MessageInfo) AS4UserMessage(com.helger.phase4.messaging.domain.AS4UserMessage) Ebms3PartyInfo(com.helger.phase4.ebms3header.Ebms3PartyInfo) Ebms3Property(com.helger.phase4.ebms3header.Ebms3Property) Nonnull(javax.annotation.Nonnull)

Example 38 with ESoapVersion

use of com.helger.phase4.soap.ESoapVersion in project phase4 by phax.

the class MockMessages method createEmptyUserMessage.

@Nonnull
@SuppressFBWarnings("NP_NONNULL_PARAM_VIOLATION")
public static Document createEmptyUserMessage(@Nonnull final ESoapVersion eSOAPVersion, @Nullable final Node aPayload, @Nullable final ICommonsList<WSS4JAttachment> aAttachments) {
    // Add properties
    final ICommonsList<Ebms3Property> aEbms3Properties = new CommonsArrayList<>();
    final Ebms3Property aEbms3PropertyProcess = new Ebms3Property();
    aEbms3Properties.add(aEbms3PropertyProcess);
    // Use an empty message info by purpose
    final Ebms3MessageInfo aEbms3MessageInfo = MessageHelperMethods.createEbms3MessageInfo();
    final Ebms3PayloadInfo aEbms3PayloadInfo = MessageHelperMethods.createEbms3PayloadInfo(aPayload != null, aAttachments);
    final Ebms3CollaborationInfo aEbms3CollaborationInfo = MessageHelperMethods.createEbms3CollaborationInfo(null, null, null, "svc", "act", "conv");
    final Ebms3PartyInfo aEbms3PartyInfo = MessageHelperMethods.createEbms3PartyInfo("fid", "frole", "tid", "trole");
    final Ebms3MessageProperties aEbms3MessageProperties = MessageHelperMethods.createEbms3MessageProperties(aEbms3Properties);
    final AS4UserMessage aDoc = AS4UserMessage.create(aEbms3MessageInfo, aEbms3PayloadInfo, aEbms3CollaborationInfo, aEbms3PartyInfo, aEbms3MessageProperties, eSOAPVersion).setMustUnderstand(true);
    return aDoc.getAsSoapDocument(aPayload);
}
Also used : Ebms3MessageProperties(com.helger.phase4.ebms3header.Ebms3MessageProperties) Ebms3PayloadInfo(com.helger.phase4.ebms3header.Ebms3PayloadInfo) Ebms3CollaborationInfo(com.helger.phase4.ebms3header.Ebms3CollaborationInfo) Ebms3MessageInfo(com.helger.phase4.ebms3header.Ebms3MessageInfo) AS4UserMessage(com.helger.phase4.messaging.domain.AS4UserMessage) CommonsArrayList(com.helger.commons.collection.impl.CommonsArrayList) Ebms3PartyInfo(com.helger.phase4.ebms3header.Ebms3PartyInfo) Ebms3Property(com.helger.phase4.ebms3header.Ebms3Property) Nonnull(javax.annotation.Nonnull) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings)

Aggregations

Nonnull (javax.annotation.Nonnull)29 Document (org.w3c.dom.Document)13 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)12 ESoapVersion (com.helger.phase4.soap.ESoapVersion)12 Ebms3MessageInfo (com.helger.phase4.ebms3header.Ebms3MessageInfo)9 Ebms3Property (com.helger.phase4.ebms3header.Ebms3Property)9 AS4UserMessage (com.helger.phase4.messaging.domain.AS4UserMessage)9 WSS4JAttachment (com.helger.phase4.attachment.WSS4JAttachment)8 Ebms3CollaborationInfo (com.helger.phase4.ebms3header.Ebms3CollaborationInfo)8 Ebms3MessageProperties (com.helger.phase4.ebms3header.Ebms3MessageProperties)8 Ebms3PartyInfo (com.helger.phase4.ebms3header.Ebms3PartyInfo)8 Ebms3PayloadInfo (com.helger.phase4.ebms3header.Ebms3PayloadInfo)8 Node (org.w3c.dom.Node)8 Ebms3Error (com.helger.phase4.ebms3header.Ebms3Error)6 Ebms3SignalMessage (com.helger.phase4.ebms3header.Ebms3SignalMessage)6 IOException (java.io.IOException)6 MessagingException (javax.mail.MessagingException)6 WSSecurityException (org.apache.wss4j.common.ext.WSSecurityException)6 AS4DecompressException (com.helger.phase4.attachment.AS4DecompressException)5 Ebms3UserMessage (com.helger.phase4.ebms3header.Ebms3UserMessage)5