public class DsCustOrd implements java.io.Serializable {
private CustOrders.CustOrders.DsCustOrdTtCust[] ttCust; private CustOrders.CustOrders.DsCustOrdTtOrder[] ttOrder; } |
public final class DsCustOrdHolder implements
javax.xml.rpc.holders.Holder { public CustOrders.CustOrders.DsCustOrd value; public DsCustOrdHolder() { } public DsCustOrdHolder(CustOrders.CustOrders.DsCustOrd value) { this.value = value; } } |
public class DsCustOrdTtOrder implements java.io.Serializable {
private java.lang.Integer orderNum; private java.lang.Integer custNum; private CustOrders.CustOrders.DsCustOrdTtOrderTtOrderLine[] ttOrderLine; ... } |
import java.net.URL;
import javax.xml.rpc.holders.*; import CustOrders.*; import CustOrders.CustOrders.*; import CustOrders.CustOrders.holders.*; public class CustOrders { public static void main(String[] args) { int iCustNum; CustOrdersObjStub appobj = null; try { CustOrdersService ws = new CustOrdersServiceLocator(); URL connectURL = new java.net.URL("http://localhost:8080/wsa/wsa1"); appobj = (CustOrdersObjStub)ws.getCustOrdersObj(connectURL); iCustNum = 1; StringHolder result = new StringHolder(); DsCustOrdHolder dsCustOrdH = new DsCustOrdHolder(); //call getCustOrders on Web service appobj.getCustOrders(iCustNum, result, dsCustOrdH); DsCustOrd dsCustOrd = dsCustOrdH.value; //print out ttCust records DsCustOrdTtCust[] ttCust = dsCustOrd.getTtCust(); for (int i = 0; i< ttCust.length; i++) { System.out.println("CustNum: " + ttCust[i].getCustNum()); System.out.println("Name: " + ttCust[i].getName()); } //print out ttOrder records DsCustOrdTtOrder ttOrder[] = dsCustOrd.getTtOrder(); for (int i = 0; i < ttOrder.length; i++) { System.out.println("OrderNum: " + ttOrder[i].getOrderNum()); System.out.println("CustNum: " + ttOrder[i].getCustNum()); // get nested ttOrderLine records DsCustOrdTtOrderTtOrderLine[] ttOrderLine = ttOrder[i].getTtOrderLine(); for (int j = 0; j < ttOrderLine.length; j++) { System.out.println("OrderNum: " + ttOrderLine[j].getOrderNum()); System.out.println("LineNum: " + ttOrderLine[j].getLineNum()); } } } catch (Exception e){ System.out.println("CAUGHT EXCEPTION - printing stack trace"); System.out.println(e.toString()); e.printStackTrace(); } } } |