<commit_before>Core Service End Point Switching
===============================

Coding structure to allow switching between Tridion Core Service End Points

===============================

We found recently that we needed to connect to the Core Service using 2 different end points. TCP in production and Basic HTTP while in development. 

The CoreServiceClient and SessionAwareCoreServiceClient share the same method names but no common interface thus switching easily between them without a code change would prove difficult.

This recipe wraps up the Core Service calls so that you need to worry about which end point you are using. This decision can be made at application start using a method of your choosing e.g. Dependency Injection.

I have exposed the following methods from the Core Service. 

*ReadSchemaFields
*Read
*GetListXml
*GetList
*GetSearchResults
*GetDefaultData
*Save
*CheckIn
*CheckOut
*IsExistingObject

Also we have merge GetList and GetListXml so that we could serialise the XElement returned by GetListXml to a list of ‘XmlListItemData’. A simple model with properties ‘Id’ and ‘Title.

*To get yourself up and running:*

1. Copy your ‘Tridion.ContentManager.CoreService.Client.dll’ into the ‘lib’ folder
2. Edit the App.config 
  1.Ensure the End Point URLs are correct
  2.Change ‘CoreService.EndPoint’ appSetting to the end point you wish to use
  3.Add a username and password to the ‘CoreService.Username’ and ‘CoreService.Password’ appSettings


Reference Projects:

https://github.com/chrismrgn/Tridion.Templates.CoreService<commit_msg>Read Me update<commit_after>Core Service End Point Switching
===============================

Coding structure to allow switching between Tridion Core Service End Points

===============================

We found recently that we needed to connect to the Core Service using 2 different end points. TCP in production and Basic HTTP while in development. 

The CoreServiceClient and SessionAwareCoreServiceClient share the same method names but no common interface thus switching easily between them without a code change would prove difficult.

This recipe wraps up the Core Service calls so that you need to worry about which end point you are using. This decision can be made at application start using a method of your choosing e.g. Dependency Injection.

I have exposed the following methods from the Core Service. 

-ReadSchemaFields
-Read
-GetListXml
-GetList
-GetSearchResults
-GetDefaultData
-Save
-CheckIn
-CheckOut
-IsExistingObject

Also we have merge GetList and GetListXml so that we could serialise the XElement returned by GetListXml to a list of ‘XmlListItemData’. A simple model with properties ‘Id’ and ‘Title.

**To get yourself up and running:**

1. Copy your ‘Tridion.ContentManager.CoreService.Client.dll’ into the ‘lib’ folder
2. Edit the App.config 
..1.Ensure the End Point URLs are correct
..2.Change ‘CoreService.EndPoint’ appSetting to the end point you wish to use
..3.Add a username and password to the ‘CoreService.Username’ and ‘CoreService.Password’ appSettings


Reference Projects:

https://github.com/chrismrgn/Tridion.Templates.CoreService (Thanks Chris)
{'fraction_non_alphanumeric': 0.08222643896268185, 'fraction_numerical': 0.003795066413662239, 'mean_word_length': 4.956685499058381, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5719274', 'n_tokens_mistral': 807, 'n_tokens_neox': 783, 'n_words': 413}