UnauthorizedAccessException using BO in web application hosted in IIS

,

Hello,
I have a web app running on IIS using Epicor’s BO to read and write through WCF. When I run the application in localhost I have no issues. I can read and write in Epicor’s DB using Business Objects. However when I deploy the application in ISS I get the error message at the bottom. I have given permission to IUSR to Epicor Clients Folder and my root application Folder. I also use the application pool identity in Annonymous Authentication (the only one that is enabled).

I was wondering if I have to add anything to my web application Web.config file under <system.serviceModel> < bindings>.

Thanx in advance!

Server is not available. Please review Server Event Logs for details.

System.UnauthorizedAccessException: Server is not available. Please review Server Event Logs for details. —> System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. —> System.ServiceModel.FaultException: Server is not available. Please review Server Event Logs for details.
— End of inner exception stack trace —

Server stack trace: at ystem.ServiceModel.Channels.SecurityChannelFactory1.SecurityDuplexChannel.ProcessMessage(Message message, TimeSpan timeout) at System.ServiceModel.Channels.SecurityChannelFactory1.SecurityDuplexChannel.TryReceive(TimeSpan timeout, Message& message)
at System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object ins, Object outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.ServiceModel.Channels.CommunicationObject.ThrowPending()
at System.ServiceModel.Channels.CommunicationObject.DoneReceivingInCurrentState()
at System.ServiceModel.Channels.SecurityChannelFactory1.SecurityDuplexChannel.BeginTryReceive(TimeSpan timeout, AsyncCallback callback, Object state) at System.ServiceModel.Dispatcher.DuplexChannelBinder.BeginTryReceive(TimeSpan timeout, AsyncCallback callback, Object state) at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.BeginTryReceive(TimeSpan timeout, AsyncCallback callback, Object state) --- End of inner exception stack trace --- at Epicor.ServiceModel.Channels.ImplBase1.ShouldRethrowNonRetryableException(Exception ex, DataSet dataSets)
at Ice.Proxy.Lib.SessionModImpl.Login()
at Ice.Core.Session…ctor(String userID, String password, String asUrl, LicenseType licenseType, String pathToConfigurationFile, Boolean fwVerCheck, String companyID, String plantID)

Check what is written in Event Viewer on server in Application log or in Epicor App Server log

I have no Event on the server in Application log. I also went in IIS log and haven’t found anything related to that. And, unfortunaly, in epicor’s server folder the newest server log is from March. Could it be disabled by the administrator?

@Olga there is no need to Specify a Service Binding in Configuration?

You get

it does not look like it is about binding. Are you calling correct URL?

Is your time in the IIS server the same as the Epicor Server? (Date time?)

1 Like

@Olga I doubt the URL is the issue since I use the exacte same .sysconfig file in localhost and I get to connect using Ice.Core.Session. I just noticed something, in the constructor I use Session.LicenseType.Default Should I use Session.LicenseType.WebService?

@josecgomez I just checked the time and it is the same.

Ice.Core.Session is on the client, your server is reported unavailable. Probably, check if Application pool for the server is started.

Overall, about binding, you need to enable same binding in server web.config that you use on the client, but for now it does not look like an issue, you simple does not get there.

The application pool is started and I see the error in a Hangfire recursive job which needs to communiate with Epicor. I guess it is related to IIS. I’m going to investigate furthermore on that.

Thank you, Jose, for the clue on the time.