Inheritance: System.ServiceModel.Web.WebServiceHost
コード例 #1
0
ファイル: Program.cs プロジェクト: tugberkugurlu/hawknet
        static void Main(string[] args)
        {
            var host = new WebServiceHost2(typeof(CustomerDataService),
                true,
                new Uri("http://localhost:8090/CustomerOData"));

            var credential = new HawkCredential
            {
                Id = "id",
                Key = "werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn",
                Algorithm = "hmacsha256",
                User = "******"
            };

            Func<string, HawkCredential> credentials = (id) => credential;

            host.Interceptors.Add(new HawkRequestInterceptor(
                credentials,
                false,
                (message) => !message.Properties.Via.AbsoluteUri.EndsWith("$metadata")));

            host.Open();

            foreach (ServiceEndpoint endpoint in host.Description.Endpoints)
            {
                Console.WriteLine("Listening at " + endpoint.Address.Uri.AbsoluteUri);
            }

            Thread.Sleep(1000);

            MakeCall(credential);

            Console.WriteLine("Press a key to exit");
            Console.ReadLine();
        }
 protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
 {
     var serviceHost = new WebServiceHost2(serviceType, true, baseAddresses);
      RequestInterceptor interceptor = DigestAuthenticationOnWCF.RequestInterceptorFactory.Create("DataWebService", "MyPrivateKey", new CustomMembershipProvider());
      serviceHost.Interceptors.Add(interceptor);
      return serviceHost;
 }
コード例 #3
0
ファイル: MockHostFactory.cs プロジェクト: barbarossia/DIS
 protected override ServiceHost CreateServiceHost(Type serviceType,
     Uri[] baseAddresses)
 {
     var serviceHost = new WebServiceHost2(serviceType, true, baseAddresses);
     serviceHost.Interceptors.Add(new MockRequestInterceptor());
     return serviceHost;
 }
コード例 #4
0
 protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
 {
     var docService = ServiceLocator.Current.GetInstance<IFileStorageService>();
     var service = new WebServiceHost2(docService, baseAddresses);
     service.MaxMessageSize = SetupInfo.MaxUploadSize != 0 ? SetupInfo.MaxUploadSize : 25*1024*1024;
     return service;
 }
コード例 #5
0
 protected override ServiceHost CreateServiceHost(Type serviceType,
     Uri[] baseAddresses)
 {
     WebServiceHost2 serviceHost = new WebServiceHost2(serviceType, true, baseAddresses);
     serviceHost.Interceptors.Add(RequestInterceptorFactory.Create(realm, membershipProvider));
     return serviceHost;
 }
コード例 #6
0
        protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
        {
            var result = new WebServiceHost2(serviceType, true, baseAddresses);

            result.Interceptors.Add(
                new DigestRequestInterceptor(new AuthenticationServiceStub("user","password"), "http://tst.com"));
            return result;
        }
コード例 #7
0
ファイル: InitIMCService.cs プロジェクト: penguinsoft/iPOS
        public override ServiceHostBase CreateServiceHost(string service, Uri[] baseAddresses)
        {
            IMCService.AutoMapper();
            IMCService.Autofac();
            WebServiceHost2 serviceHost = new WebServiceHost2(typeof(IMCService), true, baseAddresses);
            serviceHost.Interceptors.Add(new BasicRequestInterceptor(new AuthenticationServiceStub("helldemons", "_P@ssw0rds"), "iPOS"));

            return serviceHost;
        }
 protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
 {
     var serviceHost = new WebServiceHost2(serviceType, true, baseAddresses);
      serviceHost.Interceptors.Add(RequestInterceptorFactory.Create("DataWebService", new CustomMembershipProvider()));
      return serviceHost;
 }
 protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
 {
     WebServiceHost2 host = new WebServiceHost2(serviceType, true, baseAddresses);
     host.Interceptors.Add(new BasicAuthInterceptor(Membership.Provider, "NiCris"));
     return host;
 }
 protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
 {
     WebServiceHost2 host = new WebServiceHost2(serviceType, false, baseAddresses);
     return host;
 }