Answer the question
In order to leave comments, you need to log in
How to send request as url and get xml in response?
Hello!
I have a url with parameters, by which, when sending, I receive an xml body in response, depending on the contents of the body, call certain methods.
Question: How to implement this correctly, through the URI builder? Googled all over, but didn't find anything useful.
url example:
https://ups.test.ru:9083/mpterminal/work.html?USERNAME=user_name&PASSWORD= user_pwd &ACT=0&MSISDN=709772000000&PAY_AMOUNT=200&BRANCH=test_branch&SOURCE_TYPE=2&TRADE_POINT=1
<?xml version="1.0" encoding="windows-1251" ?>
<pay-response>
<pay_id>4</pay_id>
<status_code>20</status_code>
<time_stamp>DD.MM.YYYY HH24:MI:SS</ time_stamp>
</pay-response>
Answer the question
In order to leave comments, you need to log in
Good afternoon.
The URL you are accessing, I understand that this is a third-party service? And you want to use the API to contact this service from Spring and read the received response in xml and do something with it?
Read about RestTemplate
https://www.baeldung.com/rest-template
This is for sending a request to a third party service.
Here is an example of how to get xml and parse it in pojo -
https://stackoverflow.com/questions/36124081/sprin...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question