예제 #1
0
        /// <summary>
        /// Inserts row into the table associated with the
        /// data object that is requested to be updated
        /// </summary>
        /// <param name="obj">Business entity object</param>
        /// <returns>Boolean indicating success or failure</returns>
        public void Add(Object obj)
        {
            ISession session = null;

            session = GetSession();
            Log.InfoFormat("Adding data object of type {0}:", obj.ToString());
            session.Save(obj);
            LogTransactionInfo();
            Log.Info("Save completed");
        }
예제 #2
0
 /// <summary>
 /// ApplyDispatchBehavior():  This method will be used to add the
 /// ASADispatchMessageInspector behavior to the MessageInspectors collection
 /// of the dispatcher-runtime for all the endpoints of the hosted service.
 /// </summary>
 /// <param name="serviceDescription"></param>
 /// <param name="serviceHostBase"></param>
 public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
 {
     svcDescription = serviceDescription;
     _Log.Info("ApplyDispatchBehavior");
     foreach (ChannelDispatcher channelDispatcher in serviceHostBase.ChannelDispatchers)
     {
         foreach (EndpointDispatcher endpointDispatcher in channelDispatcher.Endpoints)
         {
             _Log.InfoFormat("Adding to {0}", endpointDispatcher.EndpointAddress.Uri);
             endpointDispatcher.DispatchRuntime.MessageInspectors.Add(this);
         }
     }
 }
예제 #3
0
        public void ApplyDispatchBehavior(ServiceDescription serviceDescription, System.ServiceModel.ServiceHostBase serviceHostBase)
        {
            _Log.Info("Apply Schema Validation DispatchBehavior");
            foreach (ChannelDispatcher channelDispatcher in serviceHostBase.ChannelDispatchers)
            {
                foreach (EndpointDispatcher endpointDispatcher in channelDispatcher.Endpoints)
                {
                    _Log.InfoFormat("Adding to {0}", endpointDispatcher.EndpointAddress.Uri);


                    SchemaValidationMessageInspector svmi = new SchemaValidationMessageInspector(schemaSet, validateRequest, validateReply, false);

                    endpointDispatcher.DispatchRuntime.MessageInspectors.Add(svmi);
                }
            }
        }
예제 #4
0
        /// <summary>
        /// See if a user is authenticated in Active Directory.
        /// </summary>
        /// <param name="domain">ex.) amsa</param>
        /// <param name="username"></param>
        /// <param name="pwd">The password.</param>
        /// <returns>True if the username and password exist in Active Directory; false otherwise.</returns>
        private static bool IsAuthenticated(string domain, string username, string pwd)
        {
            string         domainAndUsername = domain + @"\" + username;
            DirectoryEntry entry             = new DirectoryEntry("LDAP://" + domain, domainAndUsername, pwd);

            try
            {
                //Bind to the native AdsObject to force authentication.
                object obj = entry.NativeObject;
                return(true);
            }
            catch (Exception ex)
            {
                _Log.InfoFormat("Error authorizing user {0}\\{1} ({2})", domain, username, ex.Message);
                return(false);
            }
        }
예제 #5
0
 /// <summary>
 /// ApplyClientBehavior():  This method will be used to add the
 /// ASAClientMessageInspector behavior to the MessageInspectors collection of
 /// the client-runtime of the client proxy.
 /// </summary>
 /// <param name="serviceEndpoint"></param>
 /// <param name="behavior"></param>
 public void ApplyClientBehavior(ServiceEndpoint serviceEndpoint, System.ServiceModel.Dispatcher.ClientRuntime behavior)
 {
     svcEndpoint = serviceEndpoint;
     _Log.InfoFormat("Adding ASAClientmessageInspector behavior to {0}", serviceEndpoint.Address.Uri);
     behavior.MessageInspectors.Add(this);
 }