E9.2 How to Invoke External REST API from JDE?

vaibhavvaidya

Member
We have an existing integration with Mule where Endpoints are invoked from JDE(Consumer BSSV), we have set the Soft coding value for the endpoints as below and soft coding key as J55...it is working fine.
Now we need to invoke the End Points where the REST API need to be invoked. through SOAP utility we tried to simulate the xml schema generated in JDE logs via REST API - POST method and that worked as it is outside JDE boundary.
Now when we try using below config, we are unable to invoke from JDE.
Does BSSV Consumer with Soft Coding property support to invoke external REST API ? OR is it only possible to have it using Orchestrator?
Usually we write soft key as
<webservice>
<endpoint>http://testintegration.com/status</endpoint>
</webservice>
We changed the Soft coding value with the respective endpoint and Auth keys, even with the Record type as "External REST". Still we are unable to reach the endpoint URL , receiving 400 - Forbidden error. Are we missing any setup apart from Soft Coding or is it not possible to Invoke REST API? Please suggest...thanks in advance.
 
Orchestration it is, right? I have seen similar solutions, they use softcoding to fetch the end points and the user credentials.
 
In general, 400 forbidden is decent news- you're calling something, and the endpoint is responding! :)

Because your question relates to BSSV I won't offer anything up-- I came into the JDE Tools game from XE to 9.2, so I'm directly into orchestrator. I've done lots of rest work via orchestrator including troubleshooting 400 response.

Only general ideas I can think of is to analyze the call- is the endpoint expecting a GET and you're sending over a POST, for instance. Is there a space in the credentials, etc. Is there a healthcheck endpoint you can call that is simple to verify basic connectivity?
 
We have an existing integration with Mule where Endpoints are invoked from JDE(Consumer BSSV), we have set the Soft coding value for the endpoints as below and soft coding key as J55...it is working fine.
Now we need to invoke the End Points where the REST API need to be invoked. through SOAP utility we tried to simulate the xml schema generated in JDE logs via REST API - POST method and that worked as it is outside JDE boundary.
Now when we try using below config, we are unable to invoke from JDE.
Does BSSV Consumer with Soft Coding property support to invoke external REST API ? OR is it only possible to have it using Orchestrator?
Usually we write soft key as
<webservice>
<endpoint>http://testintegration.com/status</endpoint>
</webservice>
We changed the Soft coding value with the respective endpoint and Auth keys, even with the Record type as "External REST". Still we are unable to reach the endpoint URL , receiving 400 - Forbidden error. Are we missing any setup apart from Soft Coding or is it not possible to Invoke REST API? Please suggest...thanks in advance.

To invoke an external REST API in Orchestrator, you need the following:

0. Connectivity
1. A Connection
2. A Connector

You can create and deal with all of this inside Orchestrator. The Orchestrator Studio abstracts the Soft Coding creation for the REST Connection for you, but inside the nuts and bolts, that's how it works.

To create a connection, you must have the following information about the REST service you want to connect:
1. URI (Endpoint)
2. Security (Credentials)
3. Client Certificate
4. Proxy
5. HTTP Headers
Some of those values are optional.

Your AIS Server must be able to reach out to the REST Endpoint.

Once you fill out the REST information in the Connection, you will need a Connector.

The Connector will instantiate a Connection with the specifics of your call, such as path, body, other dynamic HTTP headers, etc.

Once you configure your Connection, you can manipulate the output of the call on the next Orchestration steps. Depending on your Tools Release, you can handle it in the Connector - like arrays assignment, etc. But most of the time, you'll need to "massage" the data using a Groovy (or JRuby or Jython) script to then be able to process to the next Orchestration step.

That's how you invoke an external REST API in Orchestrator.


I hope this helps.

- Gustavo
 
If you may be interested, we have an external commercial solution for this. Please contact me directly for more details.
Thanks for the acknowledgement , since middleware made it look like SOAP based to consume, although it's an REST APi, now it is working.
 
To invoke an external REST API in Orchestrator, you need the following:

0. Connectivity
1. A Connection
2. A Connector

You can create and deal with all of this inside Orchestrator. The Orchestrator Studio abstracts the Soft Coding creation for the REST Connection for you, but inside the nuts and bolts, that's how it works.

To create a connection, you must have the following information about the REST service you want to connect:
1. URI (Endpoint)
2. Security (Credentials)
3. Client Certificate
4. Proxy
5. HTTP Headers
Some of those values are optional.

Your AIS Server must be able to reach out to the REST Endpoint.

Once you fill out the REST information in the Connection, you will need a Connector.

The Connector will instantiate a Connection with the specifics of your call, such as path, body, other dynamic HTTP headers, etc.

Once you configure your Connection, you can manipulate the output of the call on the next Orchestration steps. Depending on your Tools Release, you can handle it in the Connector - like arrays assignment, etc. But most of the time, you'll need to "massage" the data using a Groovy (or JRuby or Jython) script to then be able to process to the next Orchestration step.

That's how you invoke an external REST API in Orchestrator.


I hope this helps.

- Gustavo
Thanks for the reply but since we are using bssv and have done soft coding property setup, we are yet to move to orchestrator. Having said that, now its working fine.
 
In general, 400 forbidden is decent news- you're calling something, and the endpoint is responding! :)

Because your question relates to BSSV I won't offer anything up-- I came into the JDE Tools game from XE to 9.2, so I'm directly into orchestrator. I've done lots of rest work via orchestrator including troubleshooting 400 response.

Only general ideas I can think of is to analyze the call- is the endpoint expecting a GET and you're sending over a POST, for instance. Is there a space in the credentials, etc. Is there a healthcheck endpoint you can call that is simple to verify basic connectivity?
Thanks for the reply Dave. We are invoking endpoints via bssv , not yet using orchestrator. Earlier we had mule as middleware where it was still working fine and now even when mule got replaced it worked recently when we do not pass any auth keys. But when we pass authkeys middleware is unable to get that info in header part, so we have invoke endpoint without any security header i.e open. Do you know how to config auth keys where middle ware can read those in header part?
 
Now since we are able to invoke end points of middleware (REST API) but without any security header or authkeys. If we try to configure x-api keys in bssv property setup, middleware is unable to find these x-api authkeys in header part and hence fails to process it further. Any thoughts or any such scenario has anyone observed before? would appreciate help. thanks in advance.
 
To invoke an external REST API from JDE, you can use the JDE Orchestrator tool, which provides a simple and efficient way to integrate JDE with external systems and services. Here are the high-level steps to invoke an external REST API from JDE using the Orchestrator:

  1. Create a new REST Connector in the Orchestrator: To create a REST Connector, go to the Orchestrator Studio, navigate to Connectors, and click on the New Connector button. Then, select the REST Connector option and configure the required details, such as the endpoint URL, authentication, and other settings.
  2. Create a new Integration: After creating the REST Connector, create a new Integration by clicking on the New Integration button. Then, select the REST Connector that you created in step 1 and configure the integration details, such as the HTTP method, payload, headers, and other settings.
  3. Test the Integration: After configuring the Integration, you can test it by clicking on the Test button in the Integration Studio. This will send a sample request to the external REST API and return the response. You can use the response data to validate the Integration and make any necessary changes.
  4. Deploy and Execute the Integration: After testing the Integration, you can deploy it to the JDE Orchestrator Server and execute it by triggering the Integration using an Event or a Scheduled Job.
 
Now since we are able to invoke end points of middleware (REST API) but without any security header or authkeys. If we try to configure x-api keys in bssv property setup, middleware is unable to find these x-api authkeys in header part and hence fails to process it further. Any thoughts or any such scenario has anyone observed before? would appreciate help. thanks in advance.
One of the ways suggested by JDE is to add the security header in the Soap Request. Please try this method.

Following are the steps taken from BSSV Development guide provided by Oracle:

If the target web service is secured with WS-Security and it requires username and password credentials to be passed to the SOAP header from the client, do the following
1. Create a class that implements the SOAPHandler interface to create the WS-Security Header with the username and password credentials retrieved from the softcoding record.
2. Create a class that implements the HandlerResolver interface, which ensures that the class that implements the SOAP Handler interface is called.
3. Create an instance of the SOAPHandler class in the client Processor class, and set the username and password credentials retrieved from the softcoding record in this instance.
4. Create an instance of the HandlerResolver class in the client Processor class, add the instance of the SOAPHandler class to this instance.
5. Add the instance of the HandlerResolver class to the instance of the target web service.
6. Set the endpoint URL, user name, and password credentials retrieved from the softcoding record in the RequestContext object of the target web service.

Refer the reference implementation object provided by JDE to see how the code is to be written to implement above steps: JRH90I34

I have used this technique in consumer BSSV (JAX-WS) and it works well.

Remember that in proxy code, the endpoint URL need to be set to " " for the softcoding override to work.

Regards,
Gautam Dasgupta
E1 9.2, Tools: 9.2.5.1
 
Does BSSV Consumer with Soft Coding property support to invoke external REST API ? OR is it only possible to have it using Orchestrator?
bssv is http request , it support to invoke rest api, you can goole "java http request"
 
Back
Top