Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • modist 9 posts 29 karma points
    Nov 11, 2012 @ 12:48
    modist
    0

    umbraco v 4.10 and Servicestack

    Hi all,

    I have been trying to create a website combining my two favourite platforms, umbraco and Servicestack.

    I have been following the steps outlined in https://github.com/ServiceStack/ServiceStack/wiki/Create-your-first-webservice - but it seems that Im having issues with step 3 - this involves Registering the web services and starting the application through global.asax.

    I've tried the suggested solution outlined in http://our.umbraco.org/documentation/Reference/Mvc/custom-routes - but still no luck.  I keep getting the errormessage "Value cannot be null. Parameter name: EndpointHost.Config" when I try to call the service - which suggest that step 3 haven't been implemented.

    below is the content of my global.asx.

    Any suggestions will be highly appreciated :-)

    using System;
    using Funq;
    using QRproject.Services;
    using ServiceStack.WebHost.Endpoints;
    namespace QRproject
    {
        public class Global : Umbraco.Web.UmbracoApplication 
        {
            public class AppHost : AppHostBase
            {
                public AppHost()
                    : base("Signup Services", typeof(CallIt).Assembly)
                {
                }
                public override void Configure(Container container)
                {
                }
            }
            protected override void OnApplicationStarted(object sender, EventArgs e)
            {
                base.OnApplicationStarted(sender, e);
                new AppHost().Init();
            }
        }
    }

  • modist 9 posts 29 karma points
    Nov 11, 2012 @ 23:07
    modist
    0

    Solved it by lookin at http://issues.umbraco.org/issue/U4-1173

    created a class with the following content :-)

     public class AppStart : IApplicationEventHandler
        {
            public class AppHost : AppHostBase
            {
                public AppHost()
                    : base("Signup Services", typeof(CallIt).Assembly)
                {
                }
                public override void Configure(Container container)
                {
                }
            }
            public void OnApplicationInitialized(UmbracoApplication httpApplication, ApplicationContext applicationContext)
            {
                //your code here
            }
            public void OnApplicationStarting(UmbracoApplication httpApplication, ApplicationContext applicationContext)
            {
                //your code here
            }
            public void OnApplicationStarted(UmbracoApplication httpApplication, ApplicationContext applicationContext)
            {
                //your code here
                new AppHost().Init();
            }
        }

     

Please Sign in or register to post replies

Write your reply to:

Draft