Search in sources :

Example 21 with ManageParticipantIdentifierServiceCaller

use of com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller in project peppol-commons by phax.

the class SMKFuncTest method testCreateAndDeletePublisher.

@Test
public void testCreateAndDeletePublisher() throws Exception {
    WSHelper.enableSoapLogging(true);
    try {
        // Create client
        final ManageServiceMetadataServiceCaller aSMPClient = new ManageServiceMetadataServiceCaller(SML_INFO);
        aSMPClient.setSSLSocketFactory(createConfiguredSSLSocketFactory(SML_INFO, false));
        final ManageParticipantIdentifierServiceCaller aPIClient = new ManageParticipantIdentifierServiceCaller(SML_INFO);
        aPIClient.setSSLSocketFactory(aSMPClient.getSSLSocketFactory());
        // Create SMP - with network logging
        LOGGER.info("CREATE SMP");
        _createSMPData(aSMPClient, SMP_ID);
        try {
            LOGGER.info("CREATE PARTICIPANT");
            aPIClient.create(SMP_ID, PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme("9915:philip"));
            try {
            } finally {
                LOGGER.info("DELETE PARTICIPANT");
                // The version with SMP_ID is required for SMK 3.0
                aPIClient.delete(SMP_ID, PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme("9915:philip"));
            }
        } finally {
            // Delete SMP
            LOGGER.info("DELETE SMP");
            aSMPClient.delete(SMP_ID);
        }
    } finally {
        WSHelper.enableSoapLogging(false);
    }
}
Also used : ManageServiceMetadataServiceCaller(com.helger.peppol.smlclient.ManageServiceMetadataServiceCaller) ManageParticipantIdentifierServiceCaller(com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller) Test(org.junit.Test)

Example 22 with ManageParticipantIdentifierServiceCaller

use of com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller in project peppol-commons by phax.

the class SMLFuncTest method testManageServiceMetadataWithManyIdentifier.

@Test
public void testManageServiceMetadataWithManyIdentifier() throws Exception {
    final ManageParticipantIdentifierServiceCaller aPIClient = new ManageParticipantIdentifierServiceCaller(SML_INFO);
    aPIClient.setSSLSocketFactory(createConfiguredSSLSocketFactory(SML_INFO, false));
    final long nStartIdentifier = 5798000999999l;
    final int nLastIdentifier = 150;
    for (int i = 0; i <= nLastIdentifier; i++) {
        LOGGER.info("Creating number: " + i);
        final long nIdentifier = nStartIdentifier + i;
        aPIClient.create(m_aServiceMetadataPublisher.getServiceMetadataPublisherID(), PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme("0088:" + nIdentifier));
    }
    m_aSMClient.delete(m_aServiceMetadataPublisher.getServiceMetadataPublisherID());
    final ServiceMetadataPublisherServiceType aServiceMetadataCreateNew = _createSMPData(m_aSMClient, SMP_ID);
    // Delete one that was on a second page
    final long nIdentifier = nStartIdentifier + nLastIdentifier;
    aPIClient.create(aServiceMetadataCreateNew.getServiceMetadataPublisherID(), PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme("0088:" + nIdentifier));
}
Also used : ServiceMetadataPublisherServiceType(com.helger.peppol.smlclient.smp.ServiceMetadataPublisherServiceType) ManageParticipantIdentifierServiceCaller(com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller) Test(org.junit.Test)

Example 23 with ManageParticipantIdentifierServiceCaller

use of com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller in project peppol-commons by phax.

the class SMLFuncTest method testManageBusinessIdentifierListWithZeroElements.

@Test
public void testManageBusinessIdentifierListWithZeroElements() throws Exception {
    final ManageParticipantIdentifierServiceCaller aPIClient = new ManageParticipantIdentifierServiceCaller(SML_INFO);
    aPIClient.setSSLSocketFactory(createConfiguredSSLSocketFactory(SML_INFO, false));
    final ICommonsList<IParticipantIdentifier> aRecipientBusinessIdentifiers = new CommonsArrayList<>();
    aPIClient.createList(aRecipientBusinessIdentifiers, SMP_ID);
    final ParticipantIdentifierPageType aResult = aPIClient.list("", m_aServiceMetadataPublisher.getServiceMetadataPublisherID());
    assertNotNull(aResult);
    final List<ParticipantIdentifierType> aBusinessIdentifiers = aResult.getParticipantIdentifier();
    assertEquals(0, aBusinessIdentifiers.size());
    m_aSMClient.delete(m_aServiceMetadataPublisher.getServiceMetadataPublisherID());
}
Also used : ParticipantIdentifierPageType(com.helger.peppol.smlclient.participant.ParticipantIdentifierPageType) ParticipantIdentifierType(com.helger.xsds.peppol.id1.ParticipantIdentifierType) ManageParticipantIdentifierServiceCaller(com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller) CommonsArrayList(com.helger.commons.collection.impl.CommonsArrayList) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) Test(org.junit.Test)

Aggregations

ManageParticipantIdentifierServiceCaller (com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller)23 Test (org.junit.Test)16 IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)13 UnauthorizedFault (com.helger.peppol.smlclient.participant.UnauthorizedFault)6 PeppolParticipantIdentifier (com.helger.peppolid.peppol.participant.PeppolParticipantIdentifier)6 ParticipantIdentifierPageType (com.helger.peppol.smlclient.participant.ParticipantIdentifierPageType)5 ParticipantIdentifierType (com.helger.xsds.peppol.id1.ParticipantIdentifierType)5 ISMLInfo (com.helger.peppol.sml.ISMLInfo)4 ManageServiceMetadataServiceCaller (com.helger.peppol.smlclient.ManageServiceMetadataServiceCaller)4 IIdentifierFactory (com.helger.peppolid.factory.IIdentifierFactory)4 ISMPParticipantMigrationManager (com.helger.phoss.smp.domain.pmigration.ISMPParticipantMigrationManager)4 ISMPSettings (com.helger.phoss.smp.settings.ISMPSettings)4 BadRequestFault (com.helger.peppol.smlclient.participant.BadRequestFault)3 ISMPServiceGroupManager (com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroupManager)3 IMicroDocument (com.helger.xml.microdom.IMicroDocument)3 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)2 PDTToString (com.helger.commons.datetime.PDTToString)2 CMimeType (com.helger.commons.mime.CMimeType)2 MimeType (com.helger.commons.mime.MimeType)2 BasicAuthClientCredentials (com.helger.http.basicauth.BasicAuthClientCredentials)2