Example 09 : Searching for an existing consignment using a consignment code

Printer-friendly version

 This will search for a consignment with the specified consignment code.

package com.metapack.dm.test;
 
import com.metapack.deliverymanager.client.Consignment;
import com.metapack.deliverymanager.client.webservices.ConsignmentSearchService;
 
public class Example9 extends ExampleBase {
 
	public void run() throws Exception {
		ConsignmentSearchService service = createConsignmentSearchService();
		Consignment consignment = service.findConsignmentByConsignmentCode( "DMC01V00LZLC" );
		if( consignment == null ) {
			System.out.println( "Consignment not found" );
		} else {
			System.out.println( "Consignment found, and it is in the \"" 
					+ consignment.getStatus() + "\" state");
		}
	}
 
}