Пример #1
0
        public static void SetPolicy(string internalurl, bool recordrequest, bool requestresponse)
        {
            if (String.IsNullOrEmpty(internalurl))
            {
                throw new ArgumentNullException("url");
            }
            TransactionalWebServicePolicy tp = new TransactionalWebServicePolicy();

            tp.PolicyType            = policyType.Transactional;
            tp.URL                   = internalurl;
            tp.RecordHeaders         = true;
            tp.RecordRequestMessage  = recordrequest;
            tp.RecordResponseMessage = requestresponse;
            tp.MachineName           = Environment.MachineName.ToLower();
            tp.BuellerEnabled        = false;
            ConfigLoader cf  = new ConfigLoader();
            PCSBinding   svc = GetPCSProxyAdmin(cf.PCSurls[0]);
            SetServicePolicyRequestMsg req = new SetServicePolicyRequestMsg();

            req.classification = new SecurityWrapper();
            req.policy         = tp;
            req.URL            = internalurl;
            svc.SetServicePolicy(req);
        }
Пример #2
0
        public static void SetPolicy(string internalurl, bool recordrequest, bool requestresponse)
        {
            if (String.IsNullOrEmpty(internalurl))
                throw new ArgumentNullException("url");
            TransactionalWebServicePolicy tp = new TransactionalWebServicePolicy();
            tp.PolicyType = policyType.Transactional;
            tp.URL = internalurl;
            tp.RecordHeaders = true;
            tp.RecordRequestMessage = recordrequest;
            tp.RecordResponseMessage = requestresponse;
            tp.MachineName = Environment.MachineName.ToLower();
            tp.BuellerEnabled = false;
            ConfigLoader cf = new ConfigLoader();
            PCSBinding svc = GetPCSProxyAdmin(cf.PCSurls[0]);
            SetServicePolicyRequestMsg req = new SetServicePolicyRequestMsg();

            req.classification = new SecurityWrapper();
            req.policy = tp;
            req.URL = internalurl;
            svc.SetServicePolicy(req);
        }