コード例 #1
0
ファイル: TM_REST.cs プロジェクト: sempf/Dev
 public static void SetRouteTable()
 {
     var webServiceHostFactory = new WebServiceHostFactory();
     var serviceRoute = new ServiceRoute(urlPath, webServiceHostFactory, typeof (TM_REST));
     RouteTable.Routes.Add(serviceRoute);
     //RouteTable.Routes.Add(new ServiceRoute(urlPath_Tests, new WebServiceHostFactory(), typeof(REST_Tests)));
 }
コード例 #2
0
ファイル: ServiceHelper.cs プロジェクト: rowlek/Rock-ChMS
#pragma warning restore

        /// <summary>
        /// Adds service routes for every <see cref="IService"/> class found through MEF.
        /// </summary>
        /// <param name="routes">The route collection.</param>
        /// <param name="routePrefix">The route prefix.</param>
        public void AddRoutes( RouteCollection routes, string routePrefix = "" )
        {
            container.ComposeParts( this );

            var factory = new WebServiceHostFactory();

            foreach ( Lazy<IService, IServiceData> i in services )
                routes.Add( new ServiceRoute( routePrefix + i.Metadata.RouteName, factory, i.Value.GetType() ) );
        }
コード例 #3
0
ファイル: Global.asax.cs プロジェクト: SuYonghuan/WCFDemo
        protected void Application_Start(object sender, EventArgs e)
        {
            System.ServiceModel.Activation.WebServiceHostFactory WSHF =
                new System.ServiceModel.Activation.WebServiceHostFactory();

            System.ServiceModel.Activation.ServiceRoute ss =
                new System.ServiceModel.Activation.ServiceRoute(
                    "wcfservice", WSHF, typeof(WCFClass.GasPriceService));
            System.Web.Routing.RouteTable.Routes.Add(ss);
        }
コード例 #4
0
ファイル: Global.asax.cs プロジェクト: squideyes/AcsDemo
        protected void Application_Start(object sender, EventArgs e)
        {
            var fileName = Path.Combine(HostingEnvironment.MapPath("~/"),
                "../../Settings/Settings.xml");

            Settings.Init(fileName);

            var factory = new WebServiceHostFactory();

            RouteTable.Routes.Add(
                new ServiceRoute("Users", factory, typeof(UserService)));
        }
コード例 #5
0
ファイル: RouteConfig.cs プロジェクト: MMP-HCKMCR/geocar-web
        public static void RegisterRoutes(RouteCollection routes)
        {
            var factory = new WebServiceHostFactory();

            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.Add(new ServiceRoute("api", factory, typeof(WebApiService)));

            routes.MapRoute(
                name: "Rental Management Console",
                url: "manage/{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
コード例 #6
0
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
                new { controller = "^(?!Services).*" }
            );

            WebServiceHostFactory factory = new WebServiceHostFactory();
            RouteTable.Routes.Add("Services", new ServiceRoute("Services", factory, typeof(ServiceController)));
        }
コード例 #7
0
ファイル: Global.asax.cs プロジェクト: shishkin/MyBlog
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            AtomAdapter.itemFactory = new SyndicationItemFactory();
            AtomAdapter.service = Blog;
            var factory = new WebServiceHostFactory();
            routes.Add(new ServiceRoute("Atom", factory, typeof(AtomAdapter)));

            routes.MapRoute(
                "Default",
                "{controller}/{action}/{id}",
                new { controller = "Home", action = "Index", id = "" }
            );
        }
コード例 #8
0
        public void Configure()
        {
            var hostFactory = new WebServiceHostFactory();

            // TODO: Review before deployment. This allows for routes to not be added if the service is self hosted.
            if (HttpContext.Current == null)
            {
                return;
            }

            this.routes.Add(new ServiceRoute("broker", hostFactory, typeof(BrokerService)));
            this.routes.Add(new ServiceRoute("counterparty", hostFactory, typeof(CounterpartyService)));
            this.routes.Add(new ServiceRoute("exchange", hostFactory, typeof(ExchangeService)));
            this.routes.Add(new ServiceRoute("legalentity", hostFactory, typeof(LegalEntityService)));
            this.routes.Add(new ServiceRoute("location", hostFactory, typeof(LocationService)));
            this.routes.Add(new ServiceRoute("party", hostFactory, typeof(PartyService)));
            this.routes.Add(new ServiceRoute("partyrole", hostFactory, typeof(PartyRoleService)));
            this.routes.Add(new ServiceRoute("person", hostFactory, typeof(PersonService)));
            this.routes.Add(new ServiceRoute("sourcesystem", hostFactory, typeof(SourceSystemService)));
            this.routes.Add(new ServiceRoute("referencedata", hostFactory, typeof(ReferenceDataService)));
        }
コード例 #9
0
 private void registerRoautes()
 {
     var factory = new WebServiceHostFactory();
     RouteTable.Routes.Add(new ServiceRoute("RestService",factory,typeof(wcfLibrary.service)));
 }
コード例 #10
0
 /// <summary>
 /// abstract the adding of routes to let us register them for metadata generation
 /// </summary>
 /// <param name="routePrefix"></param>
 /// <param name="serviceType"></param>
 /// <param name="serviceHostFactory"></param>
 private void AddRoute(string routePrefix, Type serviceType, WebServiceHostFactory serviceHostFactory)
 {
     Routes.Add(new RouteInfo { RoutePrefix = routePrefix, ServiceHostFactory = serviceHostFactory, ServiceType = serviceType });
     RouteTable.Routes.Add(new ServiceRoute(routePrefix, serviceHostFactory, serviceType));
 }
コード例 #11
0
 void Application_Start(object sender, EventArgs e)
 {
     // Code that runs on application startup
     var factory = new WebServiceHostFactory();
     RouteTable.Routes.Add(new ServiceRoute("WebServices/ProductService", factory, typeof(ProductService)));
 }