use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class SMPClientWithDNSFuncTest method testGetByDNS.
@Test
public void testGetByDNS() throws Exception {
// Make sure that the dns exists.
final String sParticipantID = "0088:5798000000001";
final String sDocumentID = "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::InvoiceDisputeDisputeInvoice##UBL-2.0";
final IParticipantIdentifier aServiceGroupID = PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme(sParticipantID);
final IDocumentTypeIdentifier aDocumentTypeID = PeppolIdentifierFactory.INSTANCE.createDocumentTypeIdentifierWithDefaultScheme(sDocumentID);
final ServiceGroupType aGroup = SMPClientReadOnly.getServiceGroupByDNS(URL_PROVIDER, SML_INFO, aServiceGroupID);
assertNotNull(aGroup);
final SignedServiceMetadataType aMetadata = SMPClientReadOnly.getServiceRegistrationByDNS(URL_PROVIDER, SML_INFO, aServiceGroupID, aDocumentTypeID);
assertNotNull(aMetadata);
}
use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class SMPClientWithDNSFuncTest method testGetByDNSForDocs.
@Test
public void testGetByDNSForDocs() throws Exception {
// ServiceGroup = participant identifier; GLN = 0088
final IParticipantIdentifier aServiceGroupID = EPredefinedParticipantIdentifierScheme.GLN.createParticipantIdentifier("5798000000001");
// Document type identifier from enumeration
@SuppressWarnings("deprecation") final IDocumentTypeIdentifier aDocumentTypeID = EPredefinedDocumentTypeIdentifier.INVOICE_T010_BIS4A_V20.getAsDocumentTypeIdentifier();
// Main call to the SMP client with the correct SML to use
final SignedServiceMetadataType aMetadata = SMPClientReadOnly.getServiceRegistrationByDNS(URL_PROVIDER, ESML.DIGIT_TEST, aServiceGroupID, aDocumentTypeID);
assertNotNull(aMetadata);
}
use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class MainSMPClientCaseSensitivity method main.
public static void main(final String[] args) throws Exception {
final IParticipantIdentifier participantId = PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme("0088:5060510050006");
LOGGER.info("Participant: " + participantId.getURIEncoded());
LOGGER.info("Participant ID case INsensitive: " + PeppolIdentifierFactory.INSTANCE.isParticipantIdentifierCaseInsensitive(participantId.getScheme()));
final SMPClientReadOnly smpClient = new SMPClientReadOnly(PeppolURLProvider.INSTANCE, participantId, ESML.DIGIT_PRODUCTION);
smpClient.setXMLSchemaValidation(false);
final IDocumentTypeIdentifier doctypeId = 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:peppol28a:ver1.0::2.1");
LOGGER.info("DocType: " + doctypeId.getURIEncoded());
LOGGER.info("DocType ID case INsensitive: " + PeppolIdentifierFactory.INSTANCE.isDocumentTypeIdentifierCaseInsensitive(doctypeId.getScheme()));
IProcessIdentifier processId = PeppolIdentifierFactory.INSTANCE.createProcessIdentifierWithDefaultScheme("URN:WWW.CENBII.EU:PROFILE:BII28:VER2.0");
LOGGER.info("Process[1]: " + processId.getURIEncoded());
LOGGER.info("Process ID case INsensitive: " + PeppolIdentifierFactory.INSTANCE.isProcessIdentifierCaseInsensitive(processId.getScheme()));
EndpointType endpoint = smpClient.getEndpoint(participantId, doctypeId, processId, ESMPTransportProfile.TRANSPORT_PROFILE_AS2);
LOGGER.info("1 - " + endpoint);
// Won't work, because process identifiers in PEPPOL are case sensitive!
processId = PeppolIdentifierFactory.INSTANCE.createProcessIdentifierWithDefaultScheme("urn:www.cenbii.eu:profile:bii28:ver2.0");
LOGGER.info("Process[2]: " + processId.getURIEncoded());
LOGGER.info("Process ID case INsensitive: " + PeppolIdentifierFactory.INSTANCE.isProcessIdentifierCaseInsensitive(processId.getScheme()));
endpoint = smpClient.getEndpoint(participantId, doctypeId, processId, ESMPTransportProfile.TRANSPORT_PROFILE_AS2);
LOGGER.info("2 - " + endpoint);
}
use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class MainSMPClientExample method main.
public static void main(final String[] args) throws Exception {
// The PEPPOL participant identifier
final IParticipantIdentifier aPI_AT_Test = PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme("9915:test");
// Create the main SMP client using the production SML
final SMPClientReadOnly aSMPClient = new SMPClientReadOnly(PeppolURLProvider.INSTANCE, aPI_AT_Test, ESML.DIGIT_TEST);
final String sEndpointAddress = aSMPClient.getEndpointAddress(aPI_AT_Test, EPredefinedDocumentTypeIdentifier.INVOICE_EN16931_PEPPOL_V30, EPredefinedProcessIdentifier.BIS3_BILLING, ESMPTransportProfile.TRANSPORT_PROFILE_PEPPOL_AS4_V2);
// Endpoint address should be "https://testap.erechnung.gv.at/as4"
LOGGER.info("The Austrian government test AS4 AP that handles invoices according to Billing BIS 3 is located at: " + sEndpointAddress);
}
use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class MainSMPClientExampleNoDNSLookup method main.
public static void main(final String[] args) throws Exception {
// The PEPPOL participant identifier
final IParticipantIdentifier aPI_AT_Test = PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme("9915:test");
// Create the main SMP client using the production SML
final SMPClientReadOnly aSMPClient = new SMPClientReadOnly(URLHelper.getAsURI("http://B-85008b8279e07ab0392da75fa55856a2.iso6523-actorid-upis.acc.edelivery.tech.ec.europa.eu"));
final String sEndpointAddress = aSMPClient.getEndpointAddress(aPI_AT_Test, EPredefinedDocumentTypeIdentifier.INVOICE_EN16931_PEPPOL_V30, EPredefinedProcessIdentifier.BIS3_BILLING, ESMPTransportProfile.TRANSPORT_PROFILE_PEPPOL_AS4_V2);
// Endpoint address should be "https://testap.erechnung.gv.at/as4"
LOGGER.info("The Austrian government test AS4 AP that handles invoices according to Billing BIS 3 is located at: " + sEndpointAddress);
}
Aggregations