Cannot create new customer
I found error: the remote server returned an error: (404) not found while creating new customer using c#.net.
try
{
Customers customers = new Customers();
Customer newCustomer = new Customer();
string urlBase = "https://cheddargetter.com/xml";
string urlPath = string.Format("/customers/new/productCode/{0}", _ProductCode);
string postParams = string.Format(
"code={0}" +
"&firstName={1}" +
"&lastName={2}" +
"&email={3}" +
"&company={4}" +
"&subscription[planCode]={5}" +
"&subscription[ccFirstName]={6}" +
"&subscription[ccLastName]={7}" +
"&subscription[ccNumber]={8}" +
"&subscription[ccExpiration]={9}" +
"&subscription[ccCardCode]={10}" +
"&subscription[ccZip]={11}",
HttpUtility.UrlEncode(customer.Code),
HttpUtility.UrlEncode(customer.FirstName),
HttpUtility.UrlEncode(customer.LastName),
HttpUtility.UrlEncode(customer.Email),
HttpUtility.UrlEncode(customer.Company),
HttpUtility.UrlEncode(customer.PlanCode.ToString().ToUpper()),
HttpUtility.UrlEncode(customer.CCFirstName),
HttpUtility.UrlEncode(customer.CCLastName),
HttpUtility.UrlEncode(customer.CCNumber),
HttpUtility.UrlEncode(customer.CCExpiration),
HttpUtility.UrlEncode(customer.CCCardCode),
HttpUtility.UrlEncode(customer.CCZip));
string result = postRequest(urlBase, urlPath, postParams);
XDocument newCustomerXML = XDocument.Parse(result);
customers = getCustomerList(newCustomerXML);
if (customers.CustomerList.Count > 0)
{
newCustomer = customers.CustomerList[0];
}
}
catch (Exception ex)
{
throw ex;
}
Please help me to solve it.
Discussions are closed to public comments.
If you need help with Cheddar please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Jess Pendley on 20 Jan, 2014 03:41 PM
Hi Dharmesh --
Without the body content of that error it's very difficult for us to determine what may have caused your call to generate a 404 response.
Capture the raw api request and you should be able to see what is generating the error. If you cannot determine it, send the information that you can acquire to us and we'll take a look for you.
Jess Pendley closed this discussion on 20 Jan, 2014 03:41 PM.