Adding business logic to SOAP to REST API convertor

Not applicable

Hi,

Is it possible to add business logic to SOAP to REST API convertor. For example in my use case, after

I receive the XML response, then I would like to do some logic based on the XML response that I got.

Thanks

Solved Solved
0 5 522
1 ACCEPTED SOLUTION

@Hussaini Zulkifli , Welcome to Apigee Community !

Yes, You can do that absolutely. SOAP to REST API converter just adds bunch of policies to the API Proxy. You can add you business logic in the response of target or proxy endpoint using out of the box policies.

See below 4MV4D video that demonstrates same using a simple stock quote soap service.

As you can see in above example, We have extracted a variable from xml payload & added a business logic that says converts the response from xml to json if the extracted stock quote value is greater than 100$.

Hope it helps. Keep us posted moving forward if any.

View solution in original post

5 REPLIES 5

@Hussaini Zulkifli , Welcome to Apigee Community !

Yes, You can do that absolutely. SOAP to REST API converter just adds bunch of policies to the API Proxy. You can add you business logic in the response of target or proxy endpoint using out of the box policies.

See below 4MV4D video that demonstrates same using a simple stock quote soap service.

As you can see in above example, We have extracted a variable from xml payload & added a business logic that says converts the response from xml to json if the extracted stock quote value is greater than 100$.

Hope it helps. Keep us posted moving forward if any.

Thanks.

Can you give example on how to implement the business logic?

@Hussaini Zulkifli , Please find updated answer above with an example. Hope it helps. If your question is answered, You can click on Accept link below the answer so that it will be helpful for others too. Keep us posted if any.

Thanks @Anil Sagar

1 more thing, is it possible too if I want to make another call after I receive the XML response? Let say I get the XML response and based on the response, I want to make another SOAP call to the system.

@Hussaini Zulkifli , Yes, You can do that, Take a look at Service Callout Policy.