vendredi 18 janvier 2019

Design pattern to use when multiple calls to the webservices are done

I am developing a microservice which calls 4 different soap webservices one after the other and response of each soap service is fed as the input request to the subsequent soap webservice. The scenario is explained as below:

micrservice
|------------------> soap service 1
       if(soap_Service1_Response.indicator is 1)
        {
                 call soap webservice 2(responseOfsoapService1)
         }
        else if(soap_Service1_Response.indicator is 2)
        {
                call soap webservice 3(responseOfsoapService2)
        }
         ........and so on.

Which design pattern to use in this scenario so that multiple if and else need not to be written. Note this calling in single service as of now.
Thanks in advance

Aucun commentaire:

Enregistrer un commentaire