Project Phase III

Due December 1 and 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 - Due December 1, 2003

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 - Due December 10, 2003

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

GroupWSDL URL
ADJhttp://iisqlsrv.cs.washington.edu/adj/newshop/ADJ_webservice.asmx?WSDL
BAMhttp://iisqlsrv.cs.washington.edu/bam/BAM_webservice.asmx?WSDL
BSKhttp://iisqlsrv.cs.washington.edu/BSK/ComposerRus/BSK_webservice.asmx?WSDL
DJVhttp://iisqlsrv.cs.washington.edu/dvj/MercuryII/DVJ_webservice.asmx?WSDL
JJRhttp://iisqlsrv.cs.washington.edu/jjr/JJR_webservice.asmx?WSDL
KADhttp://iisqlsrv.cs.washington.edu/kad/kad_webservice/KAD_webservice.asmx?WSDL
LANGhttp://iisqlsrv.cs.washington.edu/lang/lang_webservice.asmx?WSDL
MCKhttp://iisqlsrv.cs.washington.edu/mck/phaseii/mck_webservice.asmx?WSDL
MELhttp://iisqlsrv.cs.washington.edu/mel/webservice/mel_webService.asmx?WSDL
MICROSOFThttp://iisqlsrv.cs.washington.edu/microsoft/test/MICROSOFT_webService.asmx?WSDL
MTKhttp://iisqlsrv.cs.washington.edu/mtk/Copy_of_main_by_Tuan/MTK_webService.asmx
NANhttp://iisqlsrv.cs.washington.edu/nan/shopping/Web%20References/webservice/NAN_webservice.wsdl
NYKhttp://iisqlsrv.cs.washington.edu/nyk/webservicedemo/Web%20References/NYKService/NYK_webservice.wsdl
SHBhttp://iisqlsrv.cs.washington.edu/shb/WebServices/SHB_webservice.asmx?WSDL
SLUGGY
TAChttp://iisqlsrv.cs.washington.edu/tac/tac_webservice.asmx?WSDL
VADhttp://iisqlsrv.cs.washington.edu/vad/vad_WebService/Service1.asmx?WSDL

To call other people's web services is pretty like what you need to do to call your own web service. Specifically, you can follow the steps below:

  1. Add a web reference. To make things easy, after you add the reference, you can rename it to the group name. Here I rename it to Adj.


  2. Include the packet at the beginning:
  3.     using WebService.Adj;
  4. Make an instance of their web service class:
  5.     Adj transmit = new Adj();
    A standard name is ***_webService, as I required in Phase II. But there are some groups using their own names. You can find it out by reading the proxy file reference.cs.

  6. Invoke the web service method. For example:
  7.     transmit.acceptCommodityInfo(books);
  8. If you need to use their struct for input/output parameters, you also need to initiate them. Again, you can find the class name from reference.cs.
    If there are name conflicts, you need to give the namespace also. For instance:
  9.     WebService.Adj.commodityTransInfoArray books = new WebService.Adj.commodityTransInfoArray();
  10. If you add reference.cs files to your projects during coding, make sure to delete it before compiling. Or else you'll get an error.