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);
}
}
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));
}
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());
}
Aggregations