Skip to content

Commit 5b7ef4b

Browse files
committed
Using new receiver configuration
1 parent 6c60cb9 commit 5b7ef4b

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

phase4-peppol-server-webapp/src/main/java/com/helger/phase4/peppol/server/servlet/Phase4PeppolWebAppListener.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,23 @@ private static void _initPeppolAS4 ()
325325
// not
326326
Phase4PeppolDefaultReceiverConfiguration.setAPCAChecker (aAPCAChecker);
327327

328-
final String sSMPURL = APConfig.getMySmpUrl ();
329328
final String sAPURL = AS4Configuration.getThisEndpointAddress ();
330-
if (StringHelper.isNotEmpty (sSMPURL) && StringHelper.isNotEmpty (sAPURL))
329+
if (StringHelper.isNotEmpty (sAPURL))
331330
{
332331
Phase4PeppolDefaultReceiverConfiguration.setReceiverCheckEnabled (true);
333-
final SMPClientReadOnly aSMPClient = new CachingSMPClientReadOnly (URLHelper.getAsURI (sSMPURL));
334-
APConfig.applyHttpProxySettings (aSMPClient.httpClientSettings ());
335-
Phase4PeppolDefaultReceiverConfiguration.setSMPClient (aSMPClient);
332+
final String sSMPURL = APConfig.getMySmpUrl ();
333+
if (StringHelper.isNotEmpty (sSMPURL))
334+
{
335+
// Set specific SMP for checking
336+
final SMPClientReadOnly aSMPClient = new CachingSMPClientReadOnly (URLHelper.getAsURI (sSMPURL));
337+
APConfig.applyHttpProxySettings (aSMPClient.httpClientSettings ());
338+
Phase4PeppolDefaultReceiverConfiguration.setSMPClient (aSMPClient);
339+
}
340+
else
341+
{
342+
// Use any SMP for checking
343+
Phase4PeppolDefaultReceiverConfiguration.setSMLInfo (eStage.getSMLInfo ());
344+
}
336345
Phase4PeppolDefaultReceiverConfiguration.setAS4EndpointURL (sAPURL);
337346
Phase4PeppolDefaultReceiverConfiguration.setAPCertificate (aAPCert);
338347
LOGGER.info (CAS4.LIB_NAME +

0 commit comments

Comments
 (0)