Release 10.1A: OpenEdge Development:
Web Services

> ## Sample Progress 4GL and Java interface method prototypes

> The following examples show Progress 4GL prototypes and how they map to equivalent Java interface method prototypes:

> ##### Non-persistent procedure

> - Progress 4GL:

>     /* FindCustomerByNum.p */
>     DEFINE INPUT PARAMETER CustomerNumber AS INTEGER.
>     DEFINE OUTPUT PARAMETER CustomerName AS CHARACTER.

> - Java `OrderInfoObjStub` method:

>     public void findCustomerByNum
>             (int customerNumber,
>              javax.xml.rpc.holder.StringHolder customerName)

> Note: The output parameter holder class shown in bold is provided by Axis.

> ##### Persistent procedure

> - Progress 4GL:

>     /* CustomerOrder.p */
>     DEFINE INPUT PARAMETER CustNum AS INTEGER.

> Note: This procedure returns a value using the 4GL RETURN statement.

> - Java `OrderInfoObjStub` method:

>     public String createPO_CustomerOrder (int custNum)

> ##### User-defined function

> - Progress 4GL:

>     /* CustomerOrder.p */
>     FUNCTION GetTotalOrdersByNumber RETURN INTEGER
>         (Threshold AS DECIMAL):

> - Java `CustomerOrderObjStub` method:

>     public int getTotalOrdersByNumber
>              (java.math.BigDecimal threshold)

> ##### Internal procedure using a temp-table

> - Progress 4GL:

>     /* CustomerOrder.p */
>     PROCEDURE GetOrderDetails :
>        DEFINE OUTPUT PARAMETER TABLE FOR OrderDetails.

> - Java `CustomerOrderObjStub` method:

>     public void getOrderDetails
>             (OrderSvc.OrderInfo.CustomerOrder.
>              holders.ArrayOfOrderDetailsRowHolder orderDetails)

> Note: The output parameter holder class shown in bold is generated by the Axis `WSDL2Java` command.

> ##### Temp-table definition

> - Progress 4GL:

>     /* CustomerOrder.p */
>     DEFINE TEMP-TABLE OrderDetails
>         FIELD OrderNum LIKE Order.OrderNum
>         FIELD SalesRep LIKE Order.SalesRep
>         FIELD OrderDate LIKE Order.OrderDate
>         FIELD ShipDate LIKE  Order.ShipDate
>         FIELD TotalDollars AS DECIMAL
>         FIELD OrderStatus LIKE Order.OrderStatus.

> - Java `OrderDetailsRow` object:

>     public class OrderDetailsRow {
>         private java.lang.Integer orderNum;
>         private java.lang.String salesRep;
>         private java.util.Date orderDate;
>         private java.util.Date shipDate;
>         private java.math.BigDecimal totalDollars;
>         private java.lang.String orderStatus;
>         ...}

> ##### External procedure passing a TABLE-HANDLE

> - Progress 4GL:

>     /* DynTT.p */
>     DEFINE INPUT-OUTPUT PARAMETER TABLE-HANDLE ttHandle.

> - Java `DynTTObjStub` method:

>     public void DynTT
>             (DynTTSrvc.DynTT.holders.TableHandleParamHolder ttHandle)

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095