Thursday, November 21, 2019

Configure the JDeveloper Keystore to Access an Oracle SaaS Application SSL RESTful Web Service

In the following steps, configure the Oracle Sales Cloud SSL Certificate in Oracle JDeveloper.
  1. Sign in to your Oracle Cloud service.
  2. In a web browser, go to a RESTful API resource URL of your Oracle Sales Cloud instance. For example, to access the Opportunities resource, open:
    https://my-crm-server:crm-port/salesApi/resources/latest/opportunities/
  3. Click the SSL icon that appears in your browser navigation bar. For example, in Firefox it appears as a Lock icon. Click More information .
  4. In the Security tab, click View Certificate, and then click the Details Tab.
  5. Click Export. Save the file with the .crt extension in your preferred location.
  6. In Oracle JDeveloper, click the Tools menu, and then select Preferences.
  7. Click Credentials and locate the Client Trusted Certificate Keystore file.
  8. Open a command prompt with administrative privileges (in Windows, run cmd and then press control+shift enter).
  9. Navigate to the /bin sub-folder in your JRE installation folder, and run the following command:
  10. Where YOUR_FILE_NAME is an arbitrary name you choose, PATH_TO_THE_CERT_FILE_YOU_DOWNLOADED is the path to the Certificate you downloaded in step 4, and PATH_TO_THE_JDEVELOPER_KEYSTORE is the path to the JDeveloper Keystore from step 6. DemoTrustKeyStorePassPhrase is the textual passphrase for the default DemoTrust.jks (client trusted certificate keystore).
  11. The Oracle Sales Cloud Certificate is added to your local development environment, and it can be used to develop and test your Java application locally.

call rest api using java code

package cloud.interworks.bss.api.client;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Base64;
import org.json.JSONObject;

public class Main {
 
    private static final String BASE_URL = "http://beta.gocloud360.net";
    private static final String CLIENT_ID = "c5378d41-c97d-490e-868e-83667e2f530e";
    private static final String CLIENT_SECRET = "vvDzsClZZ/V3f4TM1SmkFgCfbesY8bPMYGO4TwSWfKw=";
    private static final String USERNAME = "dev_test";
    private static final String PASSWORD = "dev_test";

    public static void main(String[] args) {
        try {
            // Get access token.
            System.out.println("Starting request for access token..");
            String token = getAccessToken();
            System.out.println("Successfully received access token..\n\n" + token);
         
            // Make the API call.
            System.out.println("\n------------------------------\nStarting API call..");
            int accountID = 1;
            String response = getAccountData(token, accountID);
            System.out.println("Successfully called API method..\n\n" + response);
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
 
    private static String getAccessToken() throws Exception {
        URL url = new URL(BASE_URL + "/oauth/token");
        HttpURLConnection conn = (HttpURLConnection)url.openConnection();
        conn.setRequestMethod("POST");
        String base64Input = CLIENT_ID + ":" + CLIENT_SECRET;
        String encoded = Base64.getEncoder().encodeToString(base64Input.getBytes());
        conn.setRequestProperty("Authorization", "Basic " + encoded);
     
        String params = "grant_type=password&username=" + USERNAME + "&password=" + PASSWORD;
        conn.setDoOutput(true);
        try (DataOutputStream os = new DataOutputStream(conn.getOutputStream())) {
            os.writeBytes(params);
            os.flush();
        }
     
        StringBuilder sb = new StringBuilder();
        try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()))) {
            String line;
            while((line = br.readLine()) != null) {
                sb.append(line);
            }
        }
     
        JSONObject json = new JSONObject(sb.toString());
        return json.getString("access_token");
    }
 
    private static String getAccountData(String token, int accountID) throws Exception {
        URL url = new URL(BASE_URL + "/api/accounts/" + accountID + "/syncoptions");
        HttpURLConnection conn = (HttpURLConnection)url.openConnection();
        conn.setRequestMethod("GET");
        conn.setRequestProperty("Authorization", "Bearer " + token);
conn.setRequestProperty("X-Api-Version", "latest");
     
        StringBuilder sb = new StringBuilder();
        try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()))) {
            String line;
            while((line = br.readLine()) != null) {
                sb.append(line);
            }
        }
     
        return sb.toString();
    }
}

Can E1 Orchestrator replace WebServices?

Key Features of JD Edwards EnterpriseOne Orchestrator
  1. Form Services: invoke any series of JDE applications; with Orchestrator you can include multiple applications calls in the same Form Service.
  2. Data Service: query data from any table or business view; aggregate data from any table or business view
  3. Connectors: the ability to call any external RESTful endpoint
  4. Watchlist Service: Orchestrator allows you to run any watchlist remotely
  5. Notification Service: send emails using JDE email configuration
  6. Scripting: uses Groovy scripts to extend the Orchestrator functions

Business Benefits of EnterpriseOne Orchestrator
  • IoT: An interface between IoT devices and JD Edwards EnterpriseOne applications
  • REST Integration: An inbound/outbound, REST-based integration platform to Oracle Cloud services and third-party systems
  • Data Integrity: A guardian over your data for accuracy, currency, and consistency
  • Bot: A “bot” for automating tedious, error-prone processes
  • Notifications: A notification engine that ensures you never miss important updates

With all those awesome features, E1 Orchestrator is ready to be part of your integration projects. The real question is could it replace SOAP WebServices and become the main interface between JD Edwards and third-party applications, such as Cloud, Mobile & IoT? Though we can see it happening soon, it’s not likely today.
The WebServices call business functions directly & hence are faster than Form Services and support more workload. However, that's not the end of it; what if the orchestrations could be scheduled? Send notifications to users directly through the JDE Web UI? Connect to other databases? The possibilities are endless! 

Monday, November 18, 2019

BSSV or AIS Server

does the BSSV or AIS server better solve whatever need you to have in JD Edwards? If you’re in search of something to simply integrate with external applications, BSSV could work for you. (To make things even easier, Oracle has a set of pre-built EnterpriseOne Business Services for you.) However, if you need to integrate with social networks, smart devices, or IoT devices, consider the AIS server. Why?
Keep in mind that SOAP (which BSSV need to work) is a bit sluggish on mobile, social, and “chatty” apps, i.e. apps that require a lot of communication between client machines and central servers. The AIS server, on the other hand, uses a lightweight REST over JSON engine. Because it’s more lightweight, AIS is preferred for consumer touchpoints and IoT devices where you need real-time/nearly real-time integration speeds. (JD Edwards’ IoT Orchestrator makes things a lot easier, too

BSSV

Business Services opens up the world of Java to EnterpriseOne and opens E1 up to the web so that web applications are able to call E1 seamlessly using SOAP. A very robust framework, the BSSV server is built on top of a Java platform and allows users to execute self-contained stateless business functions like “Get Item List Price” as a web service. Users can also create new custom business services like “Generate Sales Order,” calling the base E1 master business functions to validate and create the Sales Order within E1.
For calling 3rd-party applications, Business Services can either use SOAP-based web services or Restful Services/JSON to connect EnterpriseOne to external applications.

AIS Server

An AIS server communicates between JDE EnterpriseOne and other AIS server clients. This type of server is perfect for clients or software languages that use JSON over REST. Clients that use an AIS server to interact with EnterpriseOne include:
  • Apps created with the AIS Client Java API
  • Components created using the Oracle Java Extension Toolkit (JET) that can run inside EnterpriseOne UX One pages
  • EnterpriseOne mobile apps created using the Oracle Mobile Application Framework (MAF)
  • EnterpriseOne apps created with the Oracle Application Development Framework (ADF)
  • IoT devices