Use Case:
In Oracle Integration Cloud (OIC), we had a requirement to integrate with an external SOAP service that mandates an agent setup. However, due to agent issues during development, we needed a workaround to simulate the SOAP service response and continue functional testing. The goal was to create a stub service that mimics the real SOAP service, allowing us to test our main integration flow without dependency on the actual external system or agent setup.
Solution Steps:
-
Create a Stub SOAP Connection:
- Created a new SOAP connection in OIC without agent setup and basic authentication.
- Uploaded the WSDL (with embedded XSD) of the external service to this connection.
- Ensured that the connection is fully functional for internal calls.
-
Develop a Stub Integration:
- Built a separate OIC integration that uses the above SOAP connection as a trigger.
- Hardcoded a sample SOAP response that mimics the external service's expected response.
- This stub acts as a mock service and can be updated later with more realistic data if needed.
-
Modify the Main Integration:
- In the main integration (which originally called the external SOAP service), replaced the invoke to the external service with an invoke to the stub SOAP connection.
- Used a dynamic approach to set Endpoint URL and SOAP Action in the invoke properties to point to the stub integration endpoint.
-
Use a Lookup to Manage Endpoint Properties:
- Created an OIC Lookup table to store environment-specific endpoint URLs and SOAP Actions.
- This makes switching between the stub and real service (during SIT/UAT) seamless by just updating the lookup values.
-
Mapping and Testing:
- Mapped the request payload to match the expected structure of the original service.
- Verified the response from the stub integration is structurally and functionally valid.
- Ensured the integration behaves as if it's communicating with the actual external service.
Outcome:
This stub-based approach enabled functional testing of the main integration flow without waiting for the agent setup. It allowed developers and testers to validate business logic early, improving delivery timelines. Later in SIT/UAT, switching to the real service will only require updating the lookup to point to the actual endpoint.
No comments:
Post a Comment