Microsoft Commerce Server makes use of web services to perform the e-commerce business transactions as well as other associated functionality along with the inventory and marketing.
There are mainly 4 webservices as follows:
1. Catalog Webservice – Responsible for the Products and inventory management
2. Marketing Webservice-Resposible for the management of advertisements,discounts etc
3. Order WebService – Responsible for the Order processing
4. Profile WebService – Responsible for managing Users, Creditcards, addresses etc
What we can do by extending the webservices
As all the webmethods are Virtual in original web service we can override the webmethods to fit our client’s requirement.
We can also add new customized webmethods to the web service.
/// <summary> /// Extended orders webservice from microsoft commerce server order webservice /// </summary> [WebService(Name = "ExtendedOrdersWebService", Namespace= "http://schemas.microsoft.com/CommerceServer/2006/ 06/OrdersWebService")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] public class ExtendedOrdersWebService : Microsoft.CommerceServer.Orders.WebService.OrdersWebService { /// <summary> /// Get the basket information in a dataset /// </summary> /// <param name="orderGroupId">Order Group ID</param> /// <returns>Dataset</returns> [WebMethod] public override DataSet GetBasketAsDataSet(Guid orderGroupId) { // Code goes here } /// <summary> /// Get the name to whom this order belongs /// </summary> /// <param name="orderId">Order ID</param> /// <returns>String</returns> [WebMethod] public String GetOrderOwner(Guid orderId) { // Code goes here } }
Points to remember while extending
The webservice namespace must be equal to the namespace in the original webservice.
Like
[WebService(Name = "ExtendedOrdersWebService", Namespace= http://schemas.microsoft.com/CommerceServer/2006/06/OrdersWebService)]