Application works with Core Service to read tridion items and to calculate some stuff.

Core Service is configured to use wsHttp binding.

On one environment everything works fine. But on other environment same code fails when to much items are proceed by same class.


Error getting page for tcmUri=tcm:7-3073-64 ---> 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: The message could not be processed. This is most likely because the action 'http://www.sdltridion.com/ContentManager/CoreService/2012/ICoreService/Read' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.
   --- End of inner exception stack trace ---
 Server stack trace: at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.ProcessReply(Message reply, TimeSpan timeout, SecurityProtocolCorrelationState correlationState)
   at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.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)

It is strange that sometimes error happens for page, sometimes for publication. it is not fixed code line when it will breaks.

Code is good and it works when it is only one page and few components on page are proceed, but in the case of 30 items, suddenly error is shown.

Connection to Core Service is still active before throwing the error.

Any thoughts?

2 Answers 2


Looking at the error, it seems that core service object is created once and then executing the multiple methods on the core service.

When performing multiple methods execution on core service there are chances that security context might become invalid as it has been some time since it was setup. We have faced similar issue and the solution is:

When calling any method on core service add logic to catch messagesecurityexception, in that exception block add logic to re-initialize core service object and then invoke that method again. For us, this resolved the issue.

Other thing that you should look into is: content manager database tuning by setting up periodic re-indexing. As the no of operation that are being performed are very less and for that I don't expect to see this error.


what are your core service connection settings? in there you specify timeouts, max message sizes, etc. here's an example of mine which ramps it up to allow for larger operations

  <S N="SendTimeout">00:10:00</S>
  <S N="ReceiveTimeout">00:10:00</S>
  <S N="CloseTimeout">00:10:00</S>
  <S N="SendTimeout">00:10:00</S>
  <S N="MaxReceivedMessageSize">2147483647</S>
  <S N="MaxStringContentLength">2147483647</S>
  <S N="MaxArrayLength">2147483647</S>
  <S N="MaxBytesPerRead">2147483647</S>
  <S N="MaxItemsInObjectGraph">2147483647</S>
  • Can you give information which file contains this settings? I see this %TRIDION HOME%\config\cm_cnfg_git_def.xml <add section="timeouts" key="scripttimeout">120000</add> <add section="timeouts" key="connectiontimeout">30</add> <add section="timeouts" key="querytimeout">60</add> <add section="timeouts" key="longquerytimeout">120</add> <add section="timeouts" key="scriptextensiontimeout">60</add> Commented Apr 6, 2016 at 12:29
  • this would be part of your tool which is connecting to the core service client. for me, that's a powershell tool that loads my configuration file and then establishes the connection to the core service host. so, it all depends on what you have deployed and how it's getting connected. Commented Apr 6, 2016 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.