Building a Web Service - Start with the Design


Since the goal of this series is to walk through the thought processes and tasks involved in building a commercial web service, we will start by describing exactly what functionality will be provided. Fortunately (for me, at least), it's a subject near and dear to my heart. For much of the past three years, I have been deeply involve in designing and implementing applications for warehousing and logistics. As a result of this work, I have developed a shipment rating engine.

For those of you who aren't up on the terminology of logistics, the purpose of a shipment rating engine is to determine the lowest cost to send a shipment to its destination. Now the factors that are used to determine the cost include the distance traveled, the weight of the item being shipped, how quickly the shipment needs to arrive and the type of material being shipped.

Now having the distance and weight being part of the calculation is quite natural. The delivery time affects the cost by limiting the methods that can be used to deliver the shipment. There are three main delivery methods. Full trailer loads (FTL) shipments are exactly that. A company basically fills a trailer with goods all going to the same destination. Less than load (LTL) shipping is more common. Only part of a trailer is filled, usually by goods placed on wooden palettes. The final category is small packages (SPS). You would know this group better as Federal Express or UPS. Generally speaking, the difference between these modes is the size of the package and the speed of delivery. Oh yeah. And cost. FTL shipments cost less per pound/mile than LTL which costs less than SPS.

The other factor that goes into the shipping rate calculation is the density of the material being shipped. To put it into simple terms, it costs less to ship a ton of lead than a ton of feathers. The reason? You can pack more lead then feathers into the same space. And when you're dealing with the limited space of a trailer or an airplane cargo hold, that's an important consideration.

So given this incredible wealth of useful information, what will our web service do? Simply put, I expect that people who are making shipments will provide our service with enough information for our rating engine to do its magic. The result will be a list of the delivery methods (given the delivery date, of course) valid for the shipment, along with the corresponding rate. As well, to help companies with some inventory issues that we have seen (and to help with our discussion on creating transactions within the web service structure), we will implement a basic inventory allocation mechanism. The details of the messages that we will be using appear in the next section.

You might also like...


About the author

Bruce Johnson Canada

I am the owner of a small application development consulting company that specialized in the design and implementation of Internet-based applications. While there are others who can make a web ...

Interested in writing for us? Find out more.


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debugging is anticipated with distaste, performed with reluctance, and bragged about forever.” - Dan Kaminsky