Exemple #1
0
 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)));
 }
Exemple #2
0
#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() ) );
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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)));
        }
Exemple #5
0
        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 }
            );
        }
        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)));
        }
Exemple #7
0
        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 = "" }
            );
        }
        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)));
        }
 private void registerRoautes()
 {
     var factory = new WebServiceHostFactory();
     RouteTable.Routes.Add(new ServiceRoute("RestService",factory,typeof(wcfLibrary.service)));
 }
 /// <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));
 }
 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)));
 }