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.
This phase in divided into 2 parts:
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.
Besides the web services you provided in Phase II, now you are expected to add 3 more web services.
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
)
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
)
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()
This will be updated Friday November 21, 2003
Group | WSDL URL |
---|---|
ADJ | http://iisqlsrv.cs.washington.edu/adj/newshop/ADJ_webservice.asmx?WSDL |
BAM | http://iisqlsrv.cs.washington.edu/bam/BAM_webservice.asmx?WSDL |
BSK | http://iisqlsrv.cs.washington.edu/BSK/ComposerRus/BSK_webservice.asmx?WSDL |
DJV | http://iisqlsrv.cs.washington.edu/dvj/MercuryII/DVJ_webservice.asmx?WSDL |
JJR | http://iisqlsrv.cs.washington.edu/jjr/JJR_webservice.asmx?WSDL |
KAD | http://iisqlsrv.cs.washington.edu/kad/kad_webservice/KAD_webservice.asmx?WSDL |
LANG | http://iisqlsrv.cs.washington.edu/lang/lang_webservice.asmx?WSDL |
MCK | http://iisqlsrv.cs.washington.edu/mck/phaseii/mck_webservice.asmx?WSDL |
MEL | http://iisqlsrv.cs.washington.edu/mel/webservice/mel_webService.asmx?WSDL |
MICROSOFT | http://iisqlsrv.cs.washington.edu/microsoft/test/MICROSOFT_webService.asmx?WSDL |
MTK | http://iisqlsrv.cs.washington.edu/mtk/Copy_of_main_by_Tuan/MTK_webService.asmx |
NAN | http://iisqlsrv.cs.washington.edu/nan/shopping/Web%20References/webservice/NAN_webservice.wsdl |
NYK | http://iisqlsrv.cs.washington.edu/nyk/webservicedemo/Web%20References/NYKService/NYK_webservice.wsdl |
SHB | http://iisqlsrv.cs.washington.edu/shb/WebServices/SHB_webservice.asmx?WSDL |
SLUGGY | |
TAC | http://iisqlsrv.cs.washington.edu/tac/tac_webservice.asmx?WSDL |
VAD | http://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:
using WebService.Adj;
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.
transmit.acceptCommodityInfo(books);
WebService.Adj.commodityTransInfoArray books = new WebService.Adj.commodityTransInfoArray();