Example 72 : Enabling a carrier

Printer-friendly version

 This example shows you how to enable a carrier.

package com.metapack.dm.test;
 
import com.metapack.deliverymanager.client.webservices.SetupService;
 
public class Example72 extends ExampleBase{
 
	public void run() throws Exception {
 
		SetupService service = createSetupService();
 
		/*
		 * In order to test please disable all or some of the carrier services for AMTRAK and NF1MAN
		 * in your retailer setup before running this test case. 
		 */ 
 
		String[] carrierCodes = new String[]{"AMTRAK", "NF1MAN"}; 
		boolean result = service.enableCarriers(carrierCodes);
		if (result) {
			System.out.println( "All carrier services for given carriers have been successfully enabled");
		} else {
			System.out.println( "Problem enabling all carrier services of given carriers");
		}
	} 
 
	public static void main(String[] args ){
		Example72 ex = new Example72();
		try {
			ex.run();
		} catch( Exception e ) {
			e.printStackTrace(); 
		}
	}
 
}