Hello Jagannath,
Below is my code:
CustomerServiceClient proxy = new CustomerServiceClient();
proxy.Open();
CallContext context = new CallContext();
context.Company = “MTR”;// ConfigurationManager.AppSettings[“AxOrganization”].ToString();
context.LogonAsUser = “ALBORJ"Administrator”;
AxdCustomer customer = new AxdCustomer();
AxdEntity_CustTable cust = new AxdEntity_CustTable();
cust.AccountNum = accountNumber;
cust.Currency = Currency;
cust.CustGroup = “custgroup”;
cust.OneTimeCustomer = AxdExtType_OneTimeCustomer.Yes;
cust.OneTimeCustomerSpecified = true;
//Create the party record
AxdEntity_DirParty_DirOrganization party2 = new AxdEntity_DirParty_DirOrganization();
party2.NumberOfEmployees = 0;
party2.NameAlias = fullName;
party2.Name = fullName;
//Create a postal address
AxdEntity_DirPartyPostalAddressView address = new AxdEntity_DirPartyPostalAddressView();
address.LocationName = descAddress; // descAddress;
address.Street = strAddress;
address.City = " ";
address.State = " ";
address.CountryRegionId = country;
address.Roles = “Business”;
AxdExtType_EffectiveDateTime myDateTime = new AxdExtType_EffectiveDateTime();
myDateTime.localDateTime = Convert.ToDateTime(DateTime.Now.AddDays(-1).ToString());
myDateTime.localDateTimeSpecified = true;
myDateTime.timezone = AxdEnum_Timezone.GMTMINUS0600CENTRALTIME;
myDateTime.timezoneSpecified = true;
address.ValidFrom = myDateTime;
AxdExtType_ExpirationDateTime expireDateTime = new AxdExtType_ExpirationDateTime();
expireDateTime.localDateTime = Convert.ToDateTime(DateTime.Now.AddYears(100).ToString());
expireDateTime.localDateTimeSpecified = true;
expireDateTime.timezone = AxdEnum_Timezone.GMTMINUS0600CENTRALTIME;
expireDateTime.timezoneSpecified = true;
address.ValidTo = expireDateTime;
cust.DirParty = new AxdEntity_DirParty_DirPartyTable[1] { party2 };
cust.DirParty[0].DirPartyPostalAddressView = new AxdEntity_DirPartyPostalAddressView[1] { address };
customer.CustTable = new AxdEntity_CustTable[1] { cust };
EntityKey[] ret = proxy.create(context, customer);
I am receiving the error that i mentioned before on the proxy.create line of code. Please advise…