Example 18 : Searching for consignments using an order reference

Printer-friendly version

This will search for all consignments that are associated with a particular order reference. For those it finds, it will report the unique consignment code of each.

 

package com.metapack.dm.test;
 
import com.metapack.deliverymanager.client.Consignment;
import com.metapack.deliverymanager.client.webservices.ConsignmentSearchService;
 
public class Example18 extends ExampleBase {
 
	public void run() throws Exception {
		ConsignmentSearchService service = createConsignmentSearchService();
 
		Consignment[] results = service.findConsignmentsByOrderReference( "MYORDER" );
 
		System.out.println( "There were" + results.length + " consignments matching that order" );
		for( Consignment consignment : results ) {
			System.out.println( consignment.getConsignmentCode() );
		}
	}
}