I'm trying to connect to the Core Service and retrieve a Component to check its existence.

I created a console application to call the client. In my App.config file, I added the binding and endpoint information as below. When I added a basicHttp binding, the app executed normally but no correct result. It seems that protocol is different from that used in the CMS. So I converted the binding to wsHttpBinding. But a NullReference error came out one by one.

<?xml version="1.0"?>
<add key="EndPoint" value="CoreService"/>
<add key="Username" value="USERNAME"/>
<add key="Password" value="PASSWORD"/>
    <binding name="CoreService_wsHttpBinding" transactionFlow="true" maxReceivedMessageSize="10485760">
      <readerQuotas maxStringContentLength="10485760" maxArrayLength="10485760" />
      <!-- For HTTPS, use mode="TransportWithMessageCredential" -->
      <security mode="Message">
        <message clientCredentialType="Windows" />
<endpoint name="CoreService"      address="http://localhost/webservices/CoreService201501.svc/wsHttp" binding="wsHttpBinding" bindingConfiguration="CoreService_wsHttpBinding" contract="Tridion.ContentManager.CoreService.Client.ISessionAwareCoreService">
        <dns value="localhost" />

Could anyone tell me that which config file should I refer to when I config the App.config of my application.(web.config of WebRoot or the Tridion.ContentManager.CoreService.Client.dll.config ?)

I'm a tiro in this area.
Any advice would be highly appreciated.
Thanks in advance.

  • When I use a basicHttpbinding and endpoint to create a client, it worked, but the protocolException happened. When I changed to a wsHttpBinding and endpoint to create a client, it failed.(The client I created is null.)
    – Heimei
    Nov 2, 2016 at 8:36
  • 2
    Have you seen this: github.com/TridionPractice/tridion-practice/wiki/… Nov 2, 2016 at 8:56
  • Yes. I copied the binding & endpoint information from coreservice.client.dll.config. When I use basicHttp, it came out a System.ServiceModel.ProtocolException. If changed to wsHttp, it came out a communicationobjectfaultedexception.
    – Heimei
    Nov 4, 2016 at 1:53

1 Answer 1


I am using following stuff for non-AD account. Its working fine.

following setting in my app.config

      <endpoint address="http://myend/webservices/CoreService201501.svc/wsHttp"
          binding="wsHttpBinding" bindingConfiguration="wsHttp" contract="Tridion.ContentManager.CoreService.Client.ISessionAwareCoreService"
          <dns value="localhost" />

Following to create instance of CoreService name SessionAwareCoreServiceClient("wsHttp"); this name matches with endpoint name in config

 public static Client GetClientInstance()

            if (_instance == null)
                _instance = new SessionAwareCoreServiceClient("wsHttp");

                var userName = ConfigurationManager.AppSettings["CoreServiceUserName"];
                var domain = ConfigurationManager.AppSettings["CoreServiceDomain"];
                var password = ConfigurationManager.AppSettings["CoreServicePassword"];

                NetworkCredential creds = new NetworkCredential(userName, password, domain);
                                   _instance.CoreServiceClient.ClientCredentials.Windows.ClientCredential = creds;
            return _instance;

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.