I am able to get Core Service Client, but below code throwing error :
XElement xmlCategories = _client.GetListXml(_publicationUri, new RepositoryItemsFilterData { ItemTypes = new[] { ItemType.Category } });
As this is the new code deploy to the production server, it's working fine till UAT, so I believe there are some ports needs to be open which I am missing.
Update I am getting below error mesage :
The open operation did not complete within the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout." {0: "The open operation did not complete within the allotted timeout of 00:01:00.
Also, I am using nettcp biniding,and my Production CME and Presentation servers are different. below is the code
public SessionAwareCoreServiceClient GetNewClient(string endPoint, string hostname, string username, string password)
{
EndpointAddress endpointAddress = new EndpointAddress(endPoint);
var netTcpBinding = new NetTcpBinding
{
Name = "netTcp_2013",
TransactionFlow = true,
TransactionProtocol = TransactionProtocol.OleTransactions,
MaxReceivedMessageSize = 10485760,
ReaderQuotas = new XmlDictionaryReaderQuotas
{
MaxStringContentLength = 10485760,
MaxArrayLength = 10485760
}
};
_client = new SessionAwareCoreServiceClient(netTcpBinding, endpointAddress);
_client.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential(username, password);
return _client;
}