Example 66 : Find carriers

Printer-friendly version

 This example shows all of the available carriers.

package com.metapack.dm.test;
 
import com.metapack.deliverymanager.client.CodeName;
import com.metapack.deliverymanager.client.webservices.InformationService;
 
public class Example66 extends ExampleBase {
 
	public void run() throws Exception {
		InformationService service = createInformationService();
 
		CodeName[] carriers = service.findCarriers();
		for( CodeName carrier : carriers ) {
			System.out.println( carrier.getName() + " [" + carrier.getCode() + "]" );
		}
	}
 
	public static void main(String[] args ){
		Example66 ex = new Example66();
		try {
			ex.run();
		} catch( Exception e ) {
			e.printStackTrace();
		}
	}
}