Example 69 : Disabling a carrier service

Printer-friendly version

 This example shows how to disable an array of carrier service codes

package com.metapack.dm.test;
 
import com.metapack.deliverymanager.client.webservices.SetupService;
 
public class Example69 extends ExampleBase{
 
	public void run() throws Exception {
 
		SetupService service = createSetupService();
 
                /*
		 * In order to test please enable the following carrier services
		 * in your retailer setup before running this test case.
		 * 
		 * AMTRAK:  AMKDPAKPRE1000 for D-PAK PRE 1000 -- Enabled
		 * NF1MAN: NF1ON for OVERNIGHT, NF1ECO48 for TWO DAY -- Enabled
		 * 
		 */
 
		String[] carrierServiceCodes = new String[]{"AMKDPAKPRE1000", "NF1ON", "NF1ECO48"}; 
		boolean result = service.disableCarrierServices(carrierServiceCodes);
 
		if (result) {
			System.out.println( "Carrier services have been successfully disabled");
		} else {
			System.out.println( "Problem disabling carrier services" );
 
		}
	}
 
	public static void main(String[] args ){
		Example69 ex = new Example69();
		try {
			ex.run();
		} catch( Exception e ) {
			e.printStackTrace();
		}
	}
 
}