I am getting a permissions error when running this code:
"You do not have permissions to set a value for element defaultaddress due to one of the following reasons: 1) The field is read-only; 2) An associated feature is disabled; 3) The field is available either when a record is created or updated, but not in both cases."
I am able to update employee data through the UI using the same account as for web services.
EmployeeSearch employeeSearch = new EmployeeSearch();
EmployeeSearchBasic employeeSearchBasic = new EmployeeSearchBasic();
SearchStringField fname = new SearchStringField();
fname.searchValue = "Aaron";
fname.@operator = SearchStringFieldOperator.contains;
fname.operatorSpecified = true;
employeeSearchBasic.firstName = fname;
employeeSearch.basic = employeeSearchBasic;
SearchResult response = service.search(employeeSearch);
Record[] records = response.recordList;
Employee employee = (Employee)records[0];
Console.WriteLine(employee.firstName + " " + employee.lastName + " " + employee.internalId);
//employee.firstName = "TTrevor";
//employee.officePhone = "214-783-7753";
EmployeeAddressbook address = new EmployeeAddressbook();
address.defaultShipping = true;
address.defaultShippingSpecified = true;
address.defaultBilling = false;
address.defaultBillingSpecified = true;
address.label = "Shipping Address";
address.addressee = "William Sanders";
address.attention = "William Sanders";
address.addr1 = "4765 Sunset Blvd";
address.city = "San Francisco";
address.state = "CA";
address.zip = "94131";
address.country = Country._unitedStates;
EmployeeAddressbookList addresslist = new EmployeeAddressbookList();
EmployeeAddressbook[] addresses = new EmployeeAddressbook[1];
addresses[0] = address;
addresslist.addressbook = addresses;
employee.addressbookList = addresslist;
WriteResponse empResponse = service.update(employee);
Console.WriteLine(response.status.statusDetail);
service.logout();