cancel
Showing results for 
Search instead for 
Did you mean: 

Destination Template API

Former Member
0 Kudos

Hi,

I have used the DestinationService api to create a HTTP destination this works great, but does anyone know if it is possible to create a Destination Template rather than a HTTP destination?

I have tried the following code but this all seems specific to HTTP destinations only:


// Fetch destination service instance
DestinationService dstService = null;
try {
   dstService = DestinationServiceLocator.getInstance();
} catch (DestinationException e) {
   // handle exception that can occur when intance has not yet been initialized
   System.out.println("Destination service instance not yet initialized ... tough luck!");
}
// Create an empty destination of type HTTP
Destination dst = dstService.createDestination("WSDL");
		
HTTPDestination httpDst = (HTTPDestination) dst;
httpDst.setUrl("http://www.google.com");
httpDst.setName("MyTestDestination");
httpDst.setUsernamePassword("admin", "secretadminpass");

if (dstService.existsDestination("HTTP", "MyTestDestination")) {
   // If destination exists already, update it in the destination service storage
   dstService.updateDestination("HTTP", httpDst);
} else {
   // If destination does not yet exist, store it in the destination service storage
   dstService.storeDestination("HTTP", httpDst);
}

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Related to this I was wondering if a destination could be created through the CE command line interface, I have been hunting around for documentation on this but have not found anything unfortunately. Is there any out there?