Adding, Updating and Deleting Products via API
Posted: Thu Apr 03, 2014 2:55 pm
I'm new to Able Commerce Gold so please bear with me. I am creating a WCF web service that exposes a client the ability to insert, update and delete products. I can see that using the CommerceBuilder.Products library I can create a Product in code, but where and what methods are available to me so that I can add this product to my store? Here's a glimpse at my interface below. So, when implemented in my ConfigureProductService.svc.cs file, what methods and reverences do I need to make an insert, update and delete?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using CommerceBuilder.Users;
using CommerceBuilder.Products;
namespace AbleCommerce.WebServices
{
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IConfigureProductService" in both code and config file together.
[ServiceContract]
public interface IConfigureProductService
{
public User CurrentUser { get; set; }
KeyValuePair<bool, string> InsertProduct(Product theProduct);
KeyValuePair<bool, string> UpdateProduct(Product theProduct);
KeyValuePair<bool, string> DeleteProduct(Product theProduct);
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using CommerceBuilder.Users;
using CommerceBuilder.Products;
namespace AbleCommerce.WebServices
{
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IConfigureProductService" in both code and config file together.
[ServiceContract]
public interface IConfigureProductService
{
public User CurrentUser { get; set; }
KeyValuePair<bool, string> InsertProduct(Product theProduct);
KeyValuePair<bool, string> UpdateProduct(Product theProduct);
KeyValuePair<bool, string> DeleteProduct(Product theProduct);
}
}