示例#1
0
        public static DashboardServiceClient GetService()
        {
            var _address = new EndpointAddress(serviceUrlPath);
            var _binding = new BasicHttpMessageInspectorBinding(new ServiceMessageInspector(), securityMode);

            var _service = new DashboardServiceClient(_binding, _address);

            return(_service);
        }
示例#2
0
        /// <summary>
        /// Instantiates an instance of the web service and configures the url
        /// and the credentials in the message header before returning the
        /// instance.
        /// </summary>
        /// <returns>An instance of the web service</returns>
        public static BackendDataServiceClient GetService()
        {
            BasicHttpSecurityMode securityMode = (IsSecure ? BasicHttpSecurityMode.Transport : BasicHttpSecurityMode.None);

            EndpointAddress address = new EndpointAddress(WebServiceUrlPath);
            BasicHttpMessageInspectorBinding binding = new BasicHttpMessageInspectorBinding(new HDServiceMessageInspector(), securityMode);

            BackendDataServiceClient service = new BackendDataServiceClient(binding, address);

            return(service);
        }
示例#3
0
        private void LoadMyProfile()
        {
            //Create the Message Inspector
            SPAsmxMessageInspector messageInspector = new SPAsmxMessageInspector();
            //Apply the Message Inspector to the Binding
            BasicHttpMessageInspectorBinding binding = new BasicHttpMessageInspectorBinding(messageInspector);

            EndpointAddress endpoint = new EndpointAddress(Constants.USERPROFILE_SERVICE_URL);

            UserProfileSvc.UserProfileServiceSoapClient svc = new UserProfileServiceSoapClient(binding, endpoint);
            svc.CookieContainer = App.Cookies;
            svc.GetUserProfileByNameCompleted += new EventHandler <GetUserProfileByNameCompletedEventArgs>(svc_GetUserProfileByNameCompleted);
            svc.GetUserProfileByNameAsync(App.UserName);
        }