wso2wso2-api-managerwso2-identity-serverwso2-enterprise-integratorwso2-integration-studio

back-end orchestration service in WSO2


i followed this tutorial for little bit understand how develop a service orchestration in WSO2, but still have a any questions. Ok,in the end, in the 5 step, indicate how do test the use case so run the orchestration, the steps are the next:
1.-Download a JAR file of the back-end service.
2.-Open a terminal and navigate to the direcotory where is saved the back-end JAR service.
3.-Execute the JAR file back-end service with the next line:

java -jar Hospital-Service-JDK11-2.0.0.jar

and then using "Postman API" do a test with the next request information:
1.- Method: "POST"
2.- Headers " Content-Type=application/json "
3.- URL: http://localhost:8290/healthcare/categories/surgery/reserve
4.- JSON format body:

{ 
  "name": "John Doe", 
  "dob": "1940-03-19", 
  "ssn": "234-23-525", 
  "address": "California", 
  "phone": "8770586755", 
  "email": "johndoe@gmail.com", 
  "doctor": "thomas collins", 
  "hospital": "grand oak community hospital", 
  "cardNo": "7844481124110331", 
  "appointment_date": "2025-04-02" 
} 

and i when click Send button the API do correctly, i can confirme this why in the POSTMAN i get the next response: JSON Response

The response in code in JSON code is this:

{
    "patient": "John Do",
    "actualFee": 7000.0,
    "discount": 20,
    "discounted": 5600.0,
    "paymentID": "5988f2a0-4d43-436b-9df8-703ffd75bfcb",
    "status": "Settled"
}

My ask is the next, of where exit out the "patient", "actual Fee", "discount", "discounted", "paymentID" and "status" variables??? the true i dont remember declare this variables in the tutorial, so this variables come out of the JAR back-end service?? is very important that i can comprend the funcionality this type orchestation in WSO2, i only have cause knoledge of this in M.U.L.E. interfaced with Spring TS and is my first once using WSO2, i going to very thanks if anyone oriente to me, i am scattered in WSO2.


Solution

  • When you call http://localhost:8290/healthcare/categories/surgery/reserve it goes to the resource block /categories/{category}/reserve which checks the hospital name. In your Payload the hospital name is "hospital": "grand oak community hospital" which will be routed to the Grand Oak endpoint <endpoint key="GrandOakEP"/>. Then what ever the response you get from this endpoint will be sent back to the caller. So the response you are seeing in coming from the Backend Jar.