1

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.

1 Answers1

0

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.

ycr
  • 12,828
  • 2
  • 25
  • 45
  • 1
    @ArmandoRojasValdez This si the source code of the sample backend service if you want to take a look, https://github.com/nadeeshaan/Hospital-Service – ycr Jun 05 '23 at 15:04
  • Ah ok , excellent, what happens is that i must do an flow such as this but with different variables, in fact only 3 variables where i must put a identification number and then get 3 variable relationed with the personal information of the ID numb, all this is for bank information retrieve. Then i by the understand i must have my own JAR back-end service that provides this data?. How can do this? i have been serching information about how do my own JAR back-end service but dont find how. Am I at least right? Or if I want to retrieve information, do I need to change my approach? –  Jun 05 '23 at 15:08
  • 1
    @ArmandoRojasValdez I'm really sorry, but I'm having hard time understanding what your question is. I highly recommend you to go through these trainings so you understand the basics. https://lms.wso2.com/courses/live-training-wso2-enterprise-integrator-portuguese there are English versions as well. – ycr Jun 05 '23 at 15:13
  • 1
    ok thanks friend, i going to see the code –  Jun 05 '23 at 15:27
  • Ok, i already made changes in the code so that i can use it in my project; Now how do I compile it? –  Jun 05 '23 at 15:45
  • 1
    @ArmandoRojasValdez You mean `mvn clean install`? – ycr Jun 05 '23 at 16:20
  • yes, when doing 'maven clean install' i get a 'build failure' msg error and indicates that is not possible resolve dependenies for project 'org.wso2.Hospital-Service:jar:2.0.0' and failed to collect dependencies at 'org.wso2.msf4j:msf4j-core:jar:2.0.0 -> org.wso2.carbon.messaging:org.wso2.carbon.messaging:jar:1.0.4' –  Jun 05 '23 at 21:04
  • ok thanks, i going –  Jun 06 '23 at 00:40
  • I solved it thanks for helping me, your instructions saved my life –  Jun 06 '23 at 06:49