Example 70 : Disabling a carrier

Printer-friendly version

This example shows you how to disable an array of carrier codes.

 

package com.metapack.dm.test;
 
import com.metapack.deliverymanager.client.webservices.SetupService;
 
public class Example70 extends ExampleBase{
 
	public void run() throws Exception {
 
		SetupService service = createSetupService();
 
		/*
		 * In order to test please enable 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.disableCarriers(carrierCodes);
 
		if (result) {
			System.out.println( "All Carrier services for given carriers have been successfully disabled");
		} else {
			System.out.println( "Problem disabling all carrier services of given carriers" );
		}
	}
 
	public static void main(String[] args ){
		Example70 ex = new Example70();
		try {
			ex.run();
		} catch( Exception e ) {
			e.printStackTrace(); 
		}
	}
 
}