Example 12 : Searching for delivery options
This will find the services capable of delivering the consignment. This example will make use of the default selection criteria (as it is passing null as the filter). It will then output the various options available.
package com.metapack.dm.test; import com.metapack.deliverymanager.client.Consignment; import com.metapack.deliverymanager.client.DeliveryOption; import com.metapack.deliverymanager.client.webservices.AllocationService; public class Example12 extends ExampleBase { public void run() throws Exception { AllocationService service = createAllocationService(); Consignment consignment = createDefaultConsignment( "EXAMPLE-12" , 1 ); DeliveryOption[] options = service.findDeliveryOptions( consignment , null ); for( DeliveryOption option : options ) { System.out.println( "Service " + option.getCarrierServiceCode() + " can delivery it and it will cost " + option.getCost() ); } } }

