use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class MainCheckBogusCertificateStrings method main.
public static void main(final String[] args) throws CertificateException, SMPClientException, SMPDNSResolutionException {
final IParticipantIdentifier aPI = PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme("9906:testconsip");
final SMPClientReadOnly aSMPClient = new SMPClientReadOnly(URL_PROVIDER, aPI, ESML.DIGIT_TEST);
final X509Certificate aCert = aSMPClient.getEndpointCertificate(aPI, PeppolIdentifierFactory.INSTANCE.createDocumentTypeIdentifierWithDefaultScheme("urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:www.cenbii.eu:transaction:biitrns001:ver2.0:extended:urn:www.peppol.eu:bis:peppol3a:ver2.0::2.1"), PeppolIdentifierFactory.INSTANCE.createProcessIdentifierWithDefaultScheme("urn:www.cenbii.eu:profile:bii03:ver2.0"), ESMPTransportProfile.TRANSPORT_PROFILE_AS2);
LOGGER.info(String.valueOf(aCert));
}
use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class MainCheckIfSMPIsWorking method main.
public static void main(final String[] args) throws Exception {
final URI SMP_URI = MockSMPClientConfig.getSMPURI();
final BasicAuthClientCredentials SMP_CREDENTIALS = MockSMPClientConfig.getSMPCredentials();
final IParticipantIdentifier PARTICIPANT_ID = MockSMPClientConfig.getParticipantID();
// The main SMP client
final SMPClient aClient = new SMPClient(SMP_URI);
// Ensure that the service group does not exist
LOGGER.info("Ensuring that the service group is not existing!");
if (aClient.getServiceGroupOrNull(PARTICIPANT_ID) != null) {
LOGGER.info("Deleting existing service group for init");
aClient.deleteServiceGroup(PARTICIPANT_ID, SMP_CREDENTIALS);
LOGGER.info("Finished deletion of service group");
}
// Create, read and delete the service group
LOGGER.info("Creating the new service group");
aClient.saveServiceGroup(PARTICIPANT_ID, SMP_CREDENTIALS);
LOGGER.info("Retrieving the service group");
final ServiceGroupType aSGT = aClient.getServiceGroup(PARTICIPANT_ID);
if (!SimpleParticipantIdentifier.wrap(aSGT.getParticipantIdentifier()).equals(PARTICIPANT_ID))
throw new IllegalStateException("Participant identifiers are not equal!");
LOGGER.info("Deleting the service group again");
aClient.deleteServiceGroup(PARTICIPANT_ID, SMP_CREDENTIALS);
LOGGER.info("Checking if the service group is really deleted");
if (aClient.getServiceGroupOrNull(PARTICIPANT_ID) != null)
throw new IllegalStateException("Deletion of the service group failed!");
LOGGER.info("Seems like the SMP is working as expected!");
}
use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class MainSMPServiceGroupCompleteList method main.
public static void main(final String[] args) throws Exception {
final URI SMP_URI = MockSMPClientConfig.getSMPURI();
final IParticipantIdentifier PARTICIPANT_ID = MockSMPClientConfig.getParticipantID();
// The main SMP client
final SMPClient aClient = new SMPClient(SMP_URI);
// Get the service group reference list
final CompleteServiceGroupType aCompleteServiceGroup = aClient.getCompleteServiceGroupOrNull(PARTICIPANT_ID);
if (aCompleteServiceGroup == null)
LOGGER.error("Failed to get complete service group for " + PARTICIPANT_ID);
else {
LOGGER.info(SMPDebugHelper.getAsString(aCompleteServiceGroup.getServiceGroup()));
for (final ServiceMetadataType aServiceMetadata : aCompleteServiceGroup.getServiceMetadata()) LOGGER.info(SMPDebugHelper.getAsString(aServiceMetadata));
}
LOGGER.info("Done");
}
use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class MainSMPServiceGroupDelete method main.
public static void main(final String[] args) throws Exception {
final URI SMP_URI = MockSMPClientConfig.getSMPURI();
final BasicAuthClientCredentials SMP_CREDENTIALS = MockSMPClientConfig.getSMPCredentials();
final IParticipantIdentifier PARTICIPANT_ID = MockSMPClientConfig.getParticipantID();
// The main SMP client
final SMPClient aClient = new SMPClient(SMP_URI);
// Delete the service group
aClient.deleteServiceGroup(PARTICIPANT_ID, SMP_CREDENTIALS);
LOGGER.info("Done");
}
use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class BDXRClientReadOnlyTest method testReadConnectivityTest.
@Test
@Ignore("Because it may take long to execute")
@IgnoredNaptrTest
public void testReadConnectivityTest() throws SMPDNSResolutionException, SMPClientException {
final IParticipantIdentifier aPI = SimpleIdentifierFactory.INSTANCE.createParticipantIdentifier("connectivity-partid-qns", "dynceftest1party59gw");
final IDocumentTypeIdentifier aDocTypeID = SimpleIdentifierFactory.INSTANCE.createDocumentTypeIdentifier("connectivity-docid-qns", "doc_id1");
// TOOP SML
final ISMLInfo aSMLInfo = new SMLInfo("cef-connectivity", "CEF ConnectivityTest", "connectivitytest.acc.edelivery.tech.ec.europa.eu.", "https://acc.edelivery.tech.ec.europa.eu/edelivery-sml", true);
// PEPPOL URL provider
final BDXRClientReadOnly aBDXRClient = new BDXRClientReadOnly(BDXLURLProvider.INSTANCE, aPI, aSMLInfo);
// We don't have the truststore at hand - ignore it
aBDXRClient.setVerifySignature(false);
assertEquals("https://gateway-edelivery.westeurope.cloudapp.azure.com:444/", aBDXRClient.getSMPHostURI());
final SignedServiceMetadataType aMetadata = aBDXRClient.getServiceMetadata(aPI, aDocTypeID);
assertNotNull(aMetadata);
}
Aggregations