We have a REST service based on Apache CXF that returns either XML or JSON based on what the consumer wants (indicated in the URL). How can we provide the same behaviour in centrasite ? Here is what i think:
- Create a REST service, and define a Resource in it with Content-Type as both JSON and XML
- Write two flow services for setting the BUILDER_TYPE context variable to xml and json respectively.
- Create two virtual services , one for JSON and one for XML. Specify the respective flow services in the Request Processing Step of these two virtual services.
- Consumers should then invoke the correct virtual service based on what response it wants.
Is this correct ? is there another/better way of doing this, specifically by using a single virtual service ?
CentraSite v8.2 Fix24.