Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string Deliver(String firstname, String surname, String email) //override?
- {
- //LoadCustomerDataFile();
- SoapClient client = new SoapClient();
- Console.WriteLine("Set up client.");
- client.ClientCredentials.UserName.UserName = UserName;
- client.ClientCredentials.UserName.Password = Password;
- UpdateOptions uo = new UpdateOptions();
- uo.SaveOptions = new SaveOption[1];
- uo.SaveOptions[0] = new SaveOption();
- uo.SaveOptions[0].SaveAction = SaveAction.UpdateAdd;//This set this call to act as an UpSert, meaning if the Subscriber doesn't exist it will Create if it does it will Update
- uo.SaveOptions[0].PropertyName = "*";
- DataExtensionObject deo2 = GetDataExtensionObject(firstname, surname, email);
- string result = "";
- string uRequestID2 = String.Empty;
- string uStatus2 = String.Empty;
- UpdateResult[] uResults2 = client.Update(uo, new APIObject[] { deo2 }, out uRequestID2, out uStatus2);
- Console.WriteLine("Updated!");
- result = result + "uRequestID is: " + uRequestID2 + "and uStatus is: " + uStatus2 + ". ";
- //Loop through each object returned and display the StatusMessage
- foreach (UpdateResult cr in uResults2)
- {
- result = result + " Result is: " + cr.StatusMessage;
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement