How to Stub Provider SOAP API


    I am consuming a SOAP API from a external system.

    I have to questions

    1) Is there way in Outsystems to stub the provider?

    2) What is the best way to develop the consumer, so that in dev environment it will call a local stub and only in UAT and production environment it will call the external consumer. 


Hi Yih,

1) A magic button, or something similar does not exists to stub the provider. You can expose a WebService that stub the provider or you can use external tools like SoapUI and mock the implementation there;

2) If the stub is well implemented you will just have to change the url on each environment so that in local points to the stub and UAT and PROD to the external one;

Best regards,

João Nobre


Like João said, you may get away with implementing a stub yourself, but not everything that the Platform can consume, it can also produce, so you may need to write an Extension, depending on the type of SOAP API. The way we usually handle things like this is to have a site-property or other means to detect you're in dev-mode, and have instead of calling the SOAP API directly, create an Action that exposes it (which might be better anyway, depending on the output of the SOAP API, e.g. when you want to reformat or sanitize the data, or query some data from the local DB to go along with it), and have a switch in the action that test whether you're in dev-mode, and if so, fill the output structures with test data.