We were trying to use ECL service to get list of all stub URIs or generate them if they are not already generated.
Update: I do have specific need where we have some new ECLs in a specifc folder that we want to use in some of our Components, doing it manually is taking time. I see that when I link new ECLs to my Component using Core Service, they do not give me output of URLs if the ECL does not have a stub URI. It seems I can only link a stub URI to the Component and then only I will have proper ECL linked and my Template Builder gives desired results. Hence before doing it I need to first generate their stubs and then link those stubs to my Component.
I am using below code block:
try
{
ISessionAwareEclService eclService = new SessionAwareEclServiceClient();
NetworkCredential networkCredential = new NetworkCredential(username, password);
eclService.Impersonate(username);
var types = eclService.GetDisplayTypes();
var stubUris = eclService.CreateOrGetStubUris(eclUris);
}
catch (Exception e)
{
Log.Error("Exception: ", e);
}
The binding information are as below:
<netTcpBinding>
<binding name="netTcp" transactionFlow="true" transactionProtocol="WSAtomicTransaction11" maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647"/>
</binding>
<binding name="streamDownload_netTcp" maxReceivedMessageSize="2147483647" transferMode="StreamedResponse" sendTimeout="00:20:00"/>
<binding name="streamUpload_netTcp" maxReceivedMessageSize="2147483647" transferMode="StreamedRequest" receiveTimeout="00:20:00"/>
<!-- ECL Binding -->
<binding name="EclNetTcpBinding" maxReceivedMessageSize="10485760" receiveTimeout="00:10:00" sendTimeout="00:10:00">
<readerQuotas maxArrayLength="10485760" maxStringContentLength="10485760" />
</binding>
</netTcpBinding>
And Client is created as below:
<client>
<!-- ECL Client -->
<endpoint name="eclNetTcp_2012" address="net.tcp://<our-tridion-hostname>:2660/ExternalContentLibrary/2012/netTcp" binding="netTcpBinding" bindingConfiguration="EclNetTcpBinding" contract="Tridion.ExternalContentLibrary.Service.Client.ISessionAwareEclService"/>
</client>
Note: The user used to connect is the same user that is configured in the ECL.config
. We have tried with other Admin users as well.
While trying to connect with that I am getting below error in application:
14:31:25.393|ERROR|CommunicationException: System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: msgAccessDeniedForImpersonationUser (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: Tridion.Infrastructure.Exceptions.LocalizableSecurityException: msgAccessDeniedForImpersonationUser at Tridion.ExternalContentLibrary.Service.EclService2012.AssertIsImpersonationUser(String name) at Tridion.ExternalContentLibrary.Service.EclService2012.InitializeUserContext(String impersonationName) at CreateTridion.ExternalContentLibrary.Service.EclService2012() at System.ServiceModel.InstanceContext.GetServiceInstance(Message message) at System.ServiceModel.Dispatcher.InstanceBehavior.EnsureServiceInstance(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)).
In Media Manager Logs:
2017-11-16T09:15:01 TcmServiceHost 680 msgAccessDeniedForImpersonationUser at Tridion.ExternalContentLibrary.Service.EclService2012.AssertIsImpersonationUser(String name) at Tridion.ExternalContentLibrary.Service.EclService2012.InitializeUserContext(String impersonationName) at CreateTridion.ExternalContentLibrary.Service.EclService2012() at System.ServiceModel.InstanceContext.GetServiceInstance(Message message) at System.ServiceModel.Dispatcher.InstanceBehavior.EnsureServiceInstance(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
in Event Viewer:
msgAccessDeniedForImpersonationUser StackTrace Information Details: at Tridion.ExternalContentLibrary.Service.EclService2012.AssertIsImpersonationUser(String name) at Tridion.ExternalContentLibrary.Service.EclService2012.InitializeUserContext(String impersonationName) at CreateTridion.ExternalContentLibrary.Service.EclService2012() at System.ServiceModel.InstanceContext.GetServiceInstance(Message message) at System.ServiceModel.Dispatcher.InstanceBehavior.EnsureServiceInstance(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
Also on "msgAccessDeniedForImpersonationUser" errro I tried: ServiceActivationException when deploying Flickr ECL Provider But no luck.
Can any one please help me with ECL Service.
I am curious, is this not the way I should use this?
I looked around and got more references from here about ECL Service:
Creating ECL multimedia Components using Core Service Web 8
ServiceActivationException when deploying Flickr ECL Provider