Posts

Spring Boot — Override config property value before the application startup

Image
In this article we are going to create a spring boot application in which we will set the database password by reading them from the windows credential manager. Lets create a new spring boot project from  https://start.spring.io/  with dependencies Spring web, Spring data jpa, Lombok and MySql driver. Your project structure should look like this Open this project in Intellij idea. Database Lets create a mysql database or you can use any existing database. I have created a database by name testdb and we will try to make connection to this database through our spring boot app. Windows Credential Manager Lets add an entry in the windows credential manager for our database username and password. Click on add a generic credential. Password I used here is root. Click OK to save the credential. Windows Credential Manager Java API We will be using this Java api to retrieve the username and password from windows credential manager. GitHub - dariusz-szczepaniak/java.jna.WindowsCredentialManager:

Quarkus — Consume a SOAP service using Rest Client

Image
  We will be creating a simple microservice using quarkus framework which will accept a JSON request, call a SOAP service, map the Xml response of SOAP service to JSON response and return it to the caller. In this microservice we will be consuming a SOAP service using the eclipse microprofile rest client, this SOAP service will accept country iso code and return some information about the country. SOAP service which we will be consuming in our microservice. SOAP URL http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso SOAP Request POST /websamples.countryinfo/CountryInfoService.wso HTTP/1.1 Host: webservices.oorsprong.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version=”1.0 " encoding=”utf-8" ?> < soap12:Envelope xmlns:soap12 = ”http://www.w3.org/2003/05/soap-envelope "> < soap12:Body > < FullCountryInfo xmlns = ”http://www.oorsprong.org/websamples.countryinfo "> < sCoun