Anyone has tried to programmatically re-login to Epicor? We have an issue even tho our session timeout is set to entire day, we still randomly experience session getting expired. We have a stand alone application that uses Epicor BOs and we have a session object that logs the application into Epicor and then we use various BOs to perform some tasks.
Here is a code I use but it crashes with the error below:
And here is the error:
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Collections.ObjectModel.KeyedCollection
2.AddKey(TKey key, TItem item)
at System.Collections.ObjectModel.KeyedCollection2.InsertItem(Int32 index, TItem item) at System.Collections.ObjectModel.Collection
1.Add(T item)
at Epicor.ServiceModel.Channels.ImplBase.ConfigureContextHeader()
at Epicor.ServiceModel.Channels.ImplBase.SetHeaders()
at Epicor.ServiceModel.Channels.ImplBase.HandleContractBeforeCall()
at Epicor.ServiceModel.Channels.ImplBase.CallWithCommunicationFailureRetry(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, RestRpcValueSerializer serializer)
at Epicor.ServiceModel.Channels.ImplBase.CallWithMultistepBpmHandling(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, Boolean useSparseCopy)
at Epicor.ServiceModel.Channels.ImplBase.Call(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, Boolean useSparseCopy)
at Ice.Proxy.Lib.SessionModImpl.Logout()
at Ice.Core.Session.Dispose(Boolean disposing)
at Ice.Core.Session.Dispose()