WCF shellsettings

Topics: Writing modules
Sep 11, 2013 at 12:02 PM
I'm using Orchard 1.6.1 and previously this WCF service worked on elder version of Orchard. Also we activated the Multi-tenancy module, but the stacktrace doesn't point in that direction.

I'm getting an Null Reference exception on ShellSettings in:
[NullReferenceException: Object reference not set to an instance of an object.]
   Orchard.Environment.<>c__DisplayClass1.<GetShellContext>b__0(ShellContext shellContext) +10
   System.Linq.Enumerable.Single(IEnumerable`1 source, Func`2 predicate) +172
   Orchard.Environment.DefaultOrchardHost.GetShellContext(ShellSettings shellSettings) +113
   Orchard.Wcf.OrchardServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +205
   System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1461
   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +44
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +651

[ServiceActivationException: The service '/Services/CustomDataService' cannot be activated due to an exception during compilation.  The exception message is: Object reference not set to an instance of an object..]
   System.Runtime.AsyncResult.End(IAsyncResult result) +697346
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +190
   System.ServiceModel.Activation.AspNetRouteServiceHttpHandler.EndProcessRequest(IAsyncResult result) +6
   Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) +28
   System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +96
[ServiceContract]
    public interface ICustomDataService : IDependency
    {
        /// <summary>
        /// Gets the list.
        /// </summary>
        /// <param name="login">The login.</param>
        /// <param name="password">The password.</param>
        /// <param name="date">The date.</param>
        /// <returns></returns>
        [OperationContract(Name = "GetList")]
        [WebInvoke(UriTemplate = "GetList", Method = "GET")]
        List<Booking> GetList(string login, string password, DateTime date);

        /// <summary>
        /// Gets the list hour.
        /// </summary>
        /// <param name="login">The login.</param>
        /// <param name="password">The password.</param>
        /// <param name="date">The date.</param>
        /// <param name="startHour">The start hour.</param>
        /// <param name="endHour">The end hour.</param>
        /// <returns></returns>
        [OperationContract(Name = "GetListHour")]
        [WebInvoke(UriTemplate = "GetListHour", Method = "GET")]
        List<Booking> GetListHour(string login, string password, DateTime date, string startHour, string endHour);
    }
[Serializable]
    [DataContract]
    public class Booking
    {
        /// <summary>
        /// Gets or sets the date.
        /// </summary>
        /// <value>
        /// The date.
        /// </value>
        [DataMember]
        public string Date { get; set; }

        /// <summary>
        /// Gets or sets the PNR.
        /// </summary>
        /// <value>
        /// The PNR.
        /// </value>
        [DataMember]
        public string Pnr { get; set; }

        /// <summary>
        /// Gets or sets the status.
        /// </summary>
        /// <value>
        /// The status.
        /// </value>
        [DataMember]
        public string Status { get; set; }
    }
Oct 9, 2013 at 3:54 PM
Nobody has an idea why I cannot start the WCF in an orchard module? Or can't you have multi tenancy enabled when working with WCF services?