How to fix this issue (The SSL connection could not be established, see inner exception.)?

C:\Users\edmund.leung\EpicorKineticSalesOrderSummary>dotnet build
Restore complete (0.2s)
EpicorKineticSalesOrderSummary succeeded (3.3s) → bin\Debug\net9.0\EpicorKineticSalesOrderSummary.dll

Build succeeded in 3.9s

C:\Users\edmund.leung\EpicorKineticSalesOrderSummary>dotnet run
An error occurred while retrieving the Sales Order summary: The SSL connection could not be established, see inner exception.
Press any key to exit…

C:\Users\edmund.leung\EpicorKineticSalesOrderSummary>dotnet run
An error occurred while retrieving the Sales Order summary: The SSL connection could not be established, see inner exception.
Press any key to exit…

1 Like

To help the community provide the best answer, could you include as much of the information below as you can? Your question appears to be lacking some much needed context


  • Epicor Version
  • Deployment Type (Cloud, On Prem, 3rd Party Cloud etc)
  • The business problem you’re trying to solve
  • What you’ve already tried
  • Is this a Kinetic UX (Web) or Epicor Classic issue?
  • Is it related to a Method Directive, Data Directive, Function, BAQ, UBAQ, Configurator, etc.?
  • Any screenshots, error messages, or logs.
  • Any code you’ve written (or borrowed , make sure it is property formatted)
code here
  • Steps to reproduce the issue
  • Specifically to your question:
    • What method are you calling? From Where?
    • Is it a oData method or an RPC Method? (if so which ones)
    • HTTP Method: Get Patch Post Put Delete?

For tips on how to ask questions effectively, check out this guide:
Tips for Asking Questions on the Forum

clippy-hi

4 Likes

Thanks Smith

My current version is Epicor Kinetic.
I based on the steps to install and execute. After run, it show this error. Where can I find a document that can do a basic testing.

Step 1: Prepare the Environment

Install .NET SDK
Ensure that the .NET SDK is installed on your system. You can download and install it from Microsoft’s official website.

Create a New Project
Open the command prompt or terminal and run the following command to create a new C# console application:

bash

Copy

dotnet new console -n EpicorKineticSalesOrderSummary
cd EpicorKineticSalesOrderSummary

Step 2: Write the Code

Open the Program.cs File
Open the Program.cs file using your preferred text editor or IDE (such as Visual Studio or Visual Studio Code).

Replace the Code
Copy and paste the following code into Program.cs:

csharp

Copy

using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

namespace EpicorKineticSalesOrderSummary
{
    class Program
    {
        static async Task Main(string[] args)
        {
            // Replace with the actual Epicor Kinetic API base URL
            string baseUrl = "https://your-epicor-kinetic-server/erp/api/v1/salesordersummary";
            string customerCode = "CUSTOMER_CODE"; // Replace with the actual customer code

            using (HttpClient client = new HttpClient())
            {
                client.BaseAddress = new Uri(baseUrl);
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                // If authentication is required, add the authorization header
                // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_ACCESS_TOKEN");

                string requestUri = $"?customerCode={customerCode}";

                try
                {
                    HttpResponseMessage response = await client.GetAsync(requestUri);
                    if (response.IsSuccessStatusCode)
                    {
                        string jsonResult = await response.Content.ReadAsStringAsync();
                        Console.WriteLine("Sales Order Summary:");
                        Console.WriteLine(jsonResult);
                    }
                    else
                    {
                        Console.WriteLine($"Error: {response.StatusCode} - {response.ReasonPhrase}");
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("An error occurred while retrieving the Sales Order summary: " + ex.Message);
                }
            }

            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }
    }
}

Step 3: Update Configuration

Update the Base URL
Change the value of baseUrl to the REST API endpoint of your Epicor Kinetic server.

Set the Customer Code
Replace customerCode with the actual customer code you want to query.

Authentication (if needed)
If the server requires an access token or other authentication details, add or modify the HTTP request headers as necessary.

Step 4: Build and Run the Application

Build the Application
In the command prompt, run the following command to build the application:

bash

Copy

dotnet build

Run the Application
Use the following command to run the application:

bash

Copy

dotnet run

Step 5: View the Results

The application will display the JSON response returned by the Epicor Kinetic Sales Order Summary API.

These steps should help you set up and execute the C# console application on Epicor. If you have any questions or need further assistance, feel free to ask!

Are you using the fully qualified server name or not in your URL, and does all the certificate information match?

1 Like

Hi, Hally, how can I know or check this information?

Have any document mention about this?

The fully qualified server name should be in the home page of you set the preferences for serverinth user preferences, alternatively in the config. Sys of client or the Url of the home page if you are using browser.

As far as documents are concerned start with the architecture then look at the users guides, Admin guide, then look at the customisation topics, ssrs, bpms functions classic customs then app studio.

Then look at the experts corner here.