FileDocCategorySizeDatePackage
BidService.javaAPI DocApache Axis 1.41665Sat Apr 22 18:56:52 BST 2006samples.bidbuy

BidService

public class BidService extends Object
Big/PurchaseOrder Service

Fields Summary
static int
nextReceiptNumber
Constructors Summary
Methods Summary
public java.lang.StringBuy(PurchaseOrder PO)
Process a purchase order.

return
Receipt

        String receipt = Integer.toString(nextReceiptNumber++);

        for (int i=0; i<PO.getItems().length; i++) {
            LineItem item = PO.getItems()[i];
            receipt += "\n  " + item.getQuantity() + " " + item.getName();
        }

        return receipt;
    
public voidPing()
Let the world know that we are still alive...

    
public doubleRequestForQuote(java.lang.String productName, int quantity)
Request a quote for a given quantity of a specified product

param
productName name of product
param
quantity number desired
return
Total amount in US$ for complete purchase


                                     
          
        if (quantity < 100) {
           return 1.0 * quantity;
        } if (quantity < 1000) {
           return 0.8 * quantity;
        } else {
           return 0.7 * quantity;
        }
 
    
public java.lang.StringSimpleBuy(java.lang.String productName, java.lang.String address, int quantity)
Purchase a given quantity of a specified product

param
productName name of product
param
quantity number desired
param
price desired price (!!!)
param
customerId who you are
param
shipTo where you want the goods to go
param
date where you want the goods to go
return
Receipt

        return Integer.toString(nextReceiptNumber++) + "\n" +
            quantity + " " + productName;