Project Phase III

Due December 1, and December 10, 2003

Goal

Now, as we've made enough preparation, let's co-operate with each other and do something fun!

In this phase your company is going to make real business. You are going to make profits! The web-services you've already set up can sell products to your customers. Meantime, you'll collect commodity information for your customers as well.

You will learn how to create a complex web service client through this project. And you'll have fun to run your business.

Milestones/Turnins

This phase in divided into 2 parts:

Details

Commodity information transmission web service

Provide another web service for book information transmission that can accept some basic information on books from the book provider, and update your database accordingly. The formal description of the web service is:

    struct commodityTransInfo{
        string    ISBN,                // book ISBN, given in a string
        string    title,                    // book title or music album name
        string    category,            // the category of the book
        string    author,                // the first author of the book
        float     weight,                // book weight, it may be needed to compute the shipping cost, NEW 
        float     suggestedPrice,    // suggested book selling price. You can choose your own price based on it
        float     cost,                    // the cost of selling each book. That's the cost you buy the book from the provider, plus some other minor costs
        int        maximalQuan       // the maximal number of books you can get from the provider. The total quantity in stock at your warehouses should not exceed that
    }

    struct commodityTransInfoArray{
        int                               size,         // the size of the array
        commodityTransInfo    cInfo[]
    }

    public void acceptCommodityInfo(commodityTransInfoArray ctInfo)

Note that besides the basic information of the book/CD, you are provided a cost and a suggested price. Cost is the cost to sell each book, including the price of buying the book/CD from the provider and other operating cost. It is fixed and the same to all companies. Suggested price is the price we suggest on selling each book/CD. You can give your own price and discounts based on that. Obviously, the higher the price, the more you earn for each book. But consequently, you may not get a large number of orders.

For each item, you can decide how many to get from the provider. However, you cannot get more than the maximal quantity.

Web shopping agency

Besides the web services you provided in Phase II, now you are expected to add 3 more web services.

  1. Given the title of a book, you call the web services of other companies. (Provided in the list below.) Then you return the information you collected, including which company sells the book, what is the price, what is the discount, and how many are available. To make it fair, you would like to earn some money from being an agency and ordering books for your customers. So you can add an extra 10% for the book price in other companies. 10% is just a suggestion. You can add either more or less than that.

    struct commoditySaleInfo{
        string    company
        int        quantity, 
        float     price,     
        float     discount         
    }

    struct commoditySaleInfoArray{
        int                            size,
        commoditySaleInfo  comm[]
    }

    public commoditySaleInfoArray saleInfoCollection(
        int        commodityType,    // type = 0 - book; 1 - CD
        string    title                        // book title or music album name
    )

  1. Provide a new transaction web service. In this web service, if a customer wants to order a larger quantity of books than your company can provide, instead of rejecting the order, sell them as many as you have, and book the rest from other web-shopping companies on behalf of your customer. You can make your own choice on which company to choose.
    After the transaction, return a report on which companies you buy books from, how many you buy from each of them, the price they give you and you give your customers, and the invoice numbers.
    In this stage, you need to call web-services set up by other companies in phase II to place orders.

    struct transactionInfo{
        string    companyName,            // From which company you buy this book? (this should also include your own company)
        int        quantity,                         // How many books you buy from that book?
        float     buyPrice,                       // What is the price you buy the books from that company? It should be the price provided by the company
        float     sellPrice,                         // What is the price you sell the books to your customers? It may include the service fee you get as an agency; if the company is your own company, it should equal the buyPrice.
        string    invoiceNo                      // What is the invoice no.?
    }

    struct transactionInfoArray  {
        int                     size,
        transactionInfo  saleReport[]
    }

    public transactionInfoArray  transactionAsAgency(
        int            commodityType,              // type = 0 - book; 1 - CD
        string        title,                                // book title or music album name
        int            quantity,                        // quantity to buy
        string        shippingCompanyName,    // shipping company name
        string        shippingMethodType,    // shipping method
        int            deliveryYear,                // delivery time
        int            deliveryMonth,
        int            deliveryDate,
        string        deliveryInstruction,            // special delivery instruction
        string        shippingCustormerName,    // shipping customer info
        string        shippingCustormerPhone,
        string        shippingCustormerEmail,
        string        shippingAddrStreet,
        string        shippingAddrCity,
        string        shippingAddrState,
        string        shippingAddrZip,
        string        billingCustomerName,        // billing customer info
        string        billingCustomerPhone,
        string        billingCustomerEmail,
        string        billingAddrStreet,
        string        billingAddrCity,
        string        billingAddrState,
        string        billingAddrZip,
        string        paymentMethod,                // payment method
        string        creditCardType,                // credit card info
        string        creditCardNo,
        int            creditCardExpirationYear,
        int            creditCardExpirationMonth
    )

  1. Report your business performance when required.For each book you will return, how many you've sold out, what's the selling price (after discount), how much cost and how many profits (including the profits made as an agency), and finally, how many profits you've made in total for all items.

    struct businessPerformance{
        string    title,            // book title 
        int        soldQuan,    // how many you've sold out
        float     sellingPrice,    // the selling price (after discount) of your own books
        float     totalCost,        // how much do you spend on buying those books from providers (for those books you've sold out) and from other companies as an agency
        float     totalProfit,      // how many profits do you gain on selling your own books and acting as agencies
    }

    struct businessPerformanceArray{
        int                                size,
        businessPerformance    perf[],
        float                             totalProfit
    }

    public businessPerformanceArray businessReport()

Available Web Services

This will be updated Friday November 21, 2003