Thanks for the info. I did get it to work with POST. I adjusted my web.config and I got it to work:
web.config changes public bool UpdateStock(string sku, int quantity)
{
COM_SKU theSKU = GetSKUByNumber(sku);
theSKU.SKUAvailableItems = quantity;
string url = m_BaseUrl + String.Format("/rest/ecommerce.sku/{0}", theSKU.SKUID);
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
string userP = m_UserName + ":" + m_Password;
byte[] authBytes = Encoding.UTF8.GetBytes(userP).ToArray();
req.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(authBytes));
req.Timeout = 30000;
req.Method = "PUT";
req.ContentType = @"text\xml";
string postString = string.Empty;
using (var writer = new StringWriter())
{
new XmlSerializer(theSKU.GetType()).Serialize(writer, theSKU);
postString = writer.GetStringBuilder().ToString();
}
req.ContentLength = Encoding.UTF8.GetByteCount(postString);
using (Stream sw = req.GetRequestStream())
{
byte[] bytes = Encoding.UTF8.GetBytes(postString);
sw.Write(bytes, 0, bytes.Length);
}
HttpWebResponse resp = null;
try
{
resp = (HttpWebResponse)req.GetResponse();
if (resp.StatusCode == HttpStatusCode.Created)
{
return true;
}
}
catch (Exception)
{
}
return false;
}