Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ServiceSamples/JsonConsoleApplication/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ class Program

static void Main(string[] args)
{
/* When making service requets to Sandbox or Prod AX environemnts it must be ensured that TLS version is 1.2
* .NET 4.5 supports TLS 1.2 but it is not the default protocol. The below statement can set TLS version explicity.
* Note that this statement may not work in .NET 4.0, 3.0 or below.
* Also note that in .NET 4.6 and above TLS 1.2 is the default protocol.
*/

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

var request = HttpWebRequest.Create(GetUserSessionOperationPath);
request.Headers[OAuthHelper.OAuthHeader] = OAuthHelper.GetAuthenticationHeader();
request.Method = "POST";
Expand Down
9 changes: 9 additions & 0 deletions ServiceSamples/ODataConsoleApplication/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using ODataUtility.Microsoft.Dynamics.DataEntities;
using System;
using System.Linq;
using System.Net;

namespace ODataConsoleApplication
{
Expand All @@ -12,6 +13,14 @@ class Program

static void Main(string[] args)
{
/* When making service requets to Sandbox or Prod AX environemnts it must be ensured that TLS version is 1.2
* .NET 4.5 supports TLS 1.2 but it is not the default protocol. The below statement can set TLS version explicity.
* Note that this statement may not work in .NET 4.0, 3.0 or below.
* Also note that in .NET 4.6 and above TLS 1.2 is the default protocol.
*/

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

// To test custom entities, regenerate "ODataClient.tt" file.
// https://blogs.msdn.microsoft.com/odatateam/2014/03/11/tutorial-sample-how-to-use-odata-client-code-generator-to-generate-client-side-proxy-class/

Expand Down
9 changes: 9 additions & 0 deletions ServiceSamples/PHPConsoleApplication/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

Expand All @@ -11,6 +12,14 @@ class Program
{
static void Main(string[] args)
{
/* When making service requets to Sandbox or Prod AX environemnts it must be ensured that TLS version is 1.2
* .NET 4.5 supports TLS 1.2 but it is not the default protocol. The below statement can set TLS version explicity.
* Note that this statement may not work in .NET 4.0, 3.0 or below.
* Also note that in .NET 4.6 and above TLS 1.2 is the default protocol.
*/

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

string command = @"PHP.exe";
string phpArgs = "Program.php";

Expand Down
9 changes: 9 additions & 0 deletions ServiceSamples/SoapConsoleApplication/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using AuthenticationUtility;
using SoapUtility.UserSessionServiceReference;
using System;
using System.Net;
using System.ServiceModel;
using System.ServiceModel.Channels;

Expand All @@ -13,6 +14,14 @@ class Program
[STAThread]
static void Main(string[] args)
{
/* When making service requets to Sandbox or Prod AX environemnts it must be ensured that TLS version is 1.2
* .NET 4.5 supports TLS 1.2 but it is not the default protocol. The below statement can set TLS version explicity.
* Note that this statement may not work in .NET 4.0, 3.0 or below.
* Also note that in .NET 4.6 and above TLS 1.2 is the default protocol.
*/

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

var aosUriString = ClientConfiguration.Default.UriString;

var oauthHeader = OAuthHelper.GetAuthenticationHeader();
Expand Down