You can do it. Your example is explained in
https://docs.mendix.com/howto/integration/consume-a-simple-web-service