Exposing service to portal users

Hello all,

 

I am trying to enable access for a portal user to trigger a service within Creatio. I'm following the steps as listed in this academy page but when I try to declare _baseService and publish, I receive an error saying that GlbInterviewService is "'GlbInterviewService' is a namespace but is used like a type"

 

namespace Terrasoft.Configuration.KeenGlbInterviewService
{
	using System;
	using System.IO;
	using System.Collections.Specialized;
	using System.Globalization;
	using System.Runtime;
	using System.Runtime.Serialization;
	using System.ServiceModel;
	using System.ServiceModel.Web;
	using System.ServiceModel.Activation;
	using System.Threading;
	using System.Threading.Tasks;
	using System.Web;
	using Terrasoft.Core;
	using Terrasoft.Core.Factories;
	using Terrasoft.Web.Common;
    using Terrasoft.Web.Common.ServiceRouting;
 
	#region Class: KeenGlbInterviewService
 
	[DefaultServiceRoute, SspServiceRoute]
	[ServiceContract]
	[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
	public class KeenGlbInterviewService : BaseService
	{
 
		#region Methods: Public
		private static readonly GlbInterviewService _baseService = new GlbInterviewService();
 
		[OperationContract]
		[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
		public InterviewServiceResponse Start(InterviewServiceRequest request)
		{
			return _baseService.Start(request); 
		}
 
		[OperationContract]
		[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
		public InterviewServiceResponse Complete(InterviewServiceRequest request)
		{
			return _baseService.Complete(request);
		}
 
		#endregion
 
	}
 
	#endregion
 
	#region DataContract
 
	[DataContract]
	public class InterviewServiceResponse : ConfigurationServiceResponse
	{
		[DataMember(Name = "isSuccess")]
		public bool IsSuccess {get; set;}
	}
 
	[DataContract]
	public class InterviewServiceRequest
	{
		[DataMember(Name = "interviewId")]
		public Guid InterviewId { get; set; }
	}
 
	#endregion
 
}

From what I can tell I've set everything up exactly as the article says but I still receive the error. Though they declare _baseService the same way. Any suggestions as to what I could be doing wrong?

Like 0

Like

3 comments
Best reply

Kevin Brady,

 

Ok, according to the error you should have the Terrasoft.Configuration.GlbInterviewService namespace in your system, but you try to create a new method that has the same name as the namespace (as well as your current class KeenGlbInterviewService has the same name as your namespace Terrasoft.Configuration.KeenGlbInterviewService). So theoretically adding "using Terrasoft.Configuration.GlbInterviewService" to your code should fix this issue, but still you need to rename either classes or namespaces since they shouldn't have the same name.

Hello Kevin,

 

I used the same exact code and created a source code in my local app and it didn't return error messages. Try recreating it and also check if the error message is returned from the source code you've shared.

Oleg Drobina,

I recreated the code and also tried pasting the above code directly back into Creatio to ensure that there weren't any changes that occurred in creating this post and I still received the error.

Kevin Brady,

 

Ok, according to the error you should have the Terrasoft.Configuration.GlbInterviewService namespace in your system, but you try to create a new method that has the same name as the namespace (as well as your current class KeenGlbInterviewService has the same name as your namespace Terrasoft.Configuration.KeenGlbInterviewService). So theoretically adding "using Terrasoft.Configuration.GlbInterviewService" to your code should fix this issue, but still you need to rename either classes or namespaces since they shouldn't have the same name.

Show all comments