Anonymous Webservice Error


I am trying to set up an anonymous webservice. It works fine if you are authenticated but will not work anonymously. We are on cloud instance so I had to get support to register it, so I'm not able to see exactly what they did on the back end and they will not show me.


401 - Unauthorized: Access is denied due to invalid credentials.

You do not have permission to view this directory or page using the credentials that you supplied.

I have also tried it using this alternate link, same issue but different error.



The server encountered an error processing the request. The exception message is 'Object reference not set to an instance of an object.'. See server logs for more details. The exception stack trace is:

at Terrasoft.Configuration.UsrAnonWebServ.UsrMPF.ipf(String p, Int32 s) at SyncInvokeipf(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at Terrasoft.Web.Common.ServiceModel.ThreadContextInitializer.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)


I will post my code below. Any ideas on what could be missing?

 namespace Terrasoft.Configuration.UsrAnonWebServ
    using System;
    using System.ServiceModel;
    using System.ServiceModel.Web;
    using System.ServiceModel.Activation;
    using Terrasoft.Core;
    using Terrasoft.Web.Common;
    using Terrasoft.Core.Entities; 
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class UsrMPF: BaseService
        private SystemUserConnection _systemUserConnection;
        private SystemUserConnection SystemUserConnection {
            get {
                return _systemUserConnection ?? (_systemUserConnection = (SystemUserConnection)AppConnection.SystemUserConnection);
		[WebInvoke(Method = "GET",  BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        public string ipf(string p, int s){
			/* Specify the user on whose behalf to process the HTTP request. */
            SessionHelper.SpecifyWebOperationIdentity(HttpContextAccessor.GetInstance(), SystemUserConnection.CurrentUser);
			var entity = UserConnection.EntitySchemaManager.GetInstanceByName("UsrManifestPassengers");
			var assignersEntity = entity.CreateEntity(UserConnection);
			if (assignersEntity.FetchFromDB(p))
    			assignersEntity.SetColumnValue("UsrCustomerFeedback", s);
				//return "Thank you for your feedback.";
				return SystemUserConnection.CurrentUser.ToString();
			return "Your feedback did not submit successfully. Please try again.";


Like 0



These were the instructions I had sent support.

So I need you create the svc file in ..\Terrasoft.WebApp\ServiceModel. It should be called UsrMPF.svc
The file needs the following record:
<% @ServiceHost
    Service = "Terrasoft.Configuration.UsrAnonWebServ.UsrMPF"
    Debug = "true"
    Language = "C#"
Add the following record to the ..\Terrasoft.WebApp\ServiceModel\http\services.config and ..\Terrasoft.WebApp\ServiceModel\https\services.config
    <service name="Terrasoft.Configuration.UsrAnonWebServ.UsrMPF">
        <endpoint name="UsrMPFEndPoint"
            bindingConfiguration="[Custom encoding]"
            contract="Terrasoft.Configuration.UsrAnonWebServ.UsrMPF" />
Update the web.config file:
    <location path="ServiceModel/UsrMPF.svc">
                <allow users="*" />
        <add key="AllowedLocations" value="[Previous values];ServiceModel/UsrMPF.svc"  />
Restart Creatio in IIS.


Dear Heather,


Thanks for posting your question!


For security reasons, we kindly advise our users not to share the URLs of the instances.


To get a consultation on setting up a Webservice, please contact your manager, and we'll find a solution for you.


Thank you in advance!


Best regards,


Show all comments