How do I call SOAP APIs from Oracle Fusion Field Service Hosted Plugins?

Oracle Fusion Field Service hosted plugins allows you to make SOAP API calls for external data exchange. The process involves constructing a request, sending it via JavaScript, and handling the response while ensuring security compliance.

Step 1: Construct the SOAP Request Message

  • Create a SOAP XML request that specifies the action you want to perform.
  • Include necessary parameters and data.
  • Ensure the message follows proper XML formatting.

Step 2: Send the SOAP Request from Your Plugin

  • Use JavaScript to send the SOAP request using fetch() (recommended) or XMLHttpRequest.
  • Specify the request method (POST) and headers.

Step 3: Process the Response

  • Retrieve the API response, which is usually in XML format.
  • Extract the required information using JavaScript.

Step 4: Ensure Security and Proper Setup

  • Check Cross-Origin Resource Sharing (CORS) restrictions—SOAP API requests may be blocked by browsers. If the SOAP API you are trying to access resides on a different domain than your Oracle Fusion Field Service plugin's host, you will likely encounter CORS issues. Browsers restrict web pages from making requests to different origins for security reasons.
  • Use secure authentication methods such as OAuth or API keys.

Resolve Cross-Origin Resource Sharing (CORS) restrictions

If the plug-ins are hosted externally:
  1. Navigate to Configuration > Application > Additional Resources.

    this screenshot shows the CORS

  2. Select Allow Cross-origin resource sharing (CORS) from the following web domains and provide the domain of the server on which the plug-ins are hosted.