/// <summary>
        ///
        /// Creates or updates a user in 360, identified by its login name. If
        /// the user does not exist, it is created. If it exists, it is updated to
        /// match the input.
        /// A user must be connected to an existing 360° contact person, so
        /// always call SynchronizeContactPerson in the contact service first.
        ///
        /// </summary>
        /// <returns>SynchronizeUserOKResponse</returns>
        public static SynchronizeContactPersonOKResponse SynchronizeContact(this ServiceHelper servicehelper, SynchronizeContactPersonArgsParameter synchronizeContactArgsParameter)
        {
            try
            {
                SynchronizeContactPersonArgs synchronizeContactArgs = new SynchronizeContactPersonArgs(synchronizeContactArgsParameter);

                SynchronizeContactPersonOKResponse synchronizeContactOKResponse = servicehelper.ContactService.SynchronizeContactPerson(synchronizeContactArgs);

                return(synchronizeContactOKResponse);
            }
            catch (Exception e)
            {
                //Adding explaination and throwing again, shoud be catched in application that is using the helper
                throw new Exception("Syncronizeing of Contact failed, se inner exception", e);
            }
        }
        public static CreateOrUpdateUserAndContactResponse CreateOrUpdateUserAndContact(ServiceHelper serviceHelper, UserInfo userInfo)
        {
            SynchronizeContactPersonArgsParameter synchronizeContactPersonArgsParameter = new SynchronizeContactPersonArgsParameter()
            {
                ExternalId = userInfo.ExternalId,
                Active     = userInfo.Active,
                FirstName  = userInfo.FirstName,
                LastName   = userInfo.LastName,
                Title      = userInfo.Title,
                Enterprise = userInfo.Enterprise
            };

            SynchronizeContactPersonOKResponse synchronizeContactPersonOKResponse = serviceHelper.SynchronizeContact(synchronizeContactPersonArgsParameter);

            List <SynchronizeUserArgsParameterProfilesItem> profilesItems = new List <SynchronizeUserArgsParameterProfilesItem>();

            if (userInfo.ShoudHaveProfile)
            {
                profilesItems.Add(new SynchronizeUserArgsParameterProfilesItem()
                {
                    EnterpriseId = userInfo.Enterprise,
                    Role         = "4",
                    FromDate     = DateTime.Now,
                });
            }

            SynchronizeUserArgsParameter synchronizeUserArgsParameter = new SynchronizeUserArgsParameter()
            {
                ContactExternalId = userInfo.ExternalId,
                Profiles          = profilesItems,
                Login             = userInfo.Login,
                IsActive          = userInfo.Active
            };

            SynchronizeUserOKResponse synchronizeUserOKResponse = serviceHelper.SynchronizeUser(synchronizeUserArgsParameter);

            CreateOrUpdateUserAndContactResponse createOrUpdateUserAndContactResponse = new CreateOrUpdateUserAndContactResponse()
            {
                synchronizeContactPersonOKResponse = synchronizeContactPersonOKResponse,
                synchronizeUserOKResponset         = synchronizeUserOKResponse
            };

            return(createOrUpdateUserAndContactResponse);
        }