Hello all, Looking for any feedback on web service design for the following scenario:
Problem: An on-line book store Acme.com needs a web service that allows book publishers to maintain their own list of products available. Examples: - Addison-Wesley calls the web service to add 100 titles - MSPress call the web service to update pricing for 10 titles and remove 3 discontinued titles from their existing list of books with Acme. Possible Design of Web Service interface: AddNewBooks( string accountName, string xmlBooks ) UpdatePricing( string accountName, string xmlBooks ) RemoveBooksFromAvailbility( string accountName, string xmlBooks ) Where xmlBooks is a XML document something like this (simplified): <BookList> <Version>1.0</Version> <Book id=23> <Title>Great New Book</Title> <ISBN>xxx-xxxx-xxx<ISBN> <PriceTier id=3> <Price>30.00</Price> <QuantityRequired>1</QuantityRequired> </PriceTier> <PriceTier id=5> <Price>25.00</Price> <QuantityRequired>10</QuantityRequired> </PriceTier> </Book> <Book id='38'> <Title>Not so good Book</Title> <ISBN>xxx-xxxx-xxx<ISBN> <PriceTier id=6> <Price>42.00</Price> <QuantityRequired>1</QuantityRequired> </PriceTier> </Book> </BookList> Questions: So the question is really does this sound like a reasonable interface for this type of problem? Would you have other ideas or have you seen other best practices for dealing with inventories of items like this? Do these decision points below sound good or bad? (1) All data is passed as a string representing a XML document. This is to make it possible to add future data extensions while not requiring clients to constantly call new API revisions. The schema of the XML document would define what is sent/received. (2) There is Id attribute on the Book and PriceTier elements. I was hesitant to add this because I want keep the web service abstracted away from datastore details, but it seems even if a service is datastore independent it is still reasonable to have a unique key to differentiate items. Any comments appreciated - Regards, steak =================================== This list is hosted by DevelopMentorŪ http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com