Files
gs-consuming-web-service/complete/src/main/java/com/example/consumingwebservice/ConsumingWebServiceApplication.java
Jay Bryant ac586e1611 Use the Spring Initializr (and Boot 2.2)
I rewrote the document and the code (mostly changing package names) to use the Spring Initializr. I also modified the build files to use Spring Boot 2.2.0, which necessitated replacing the Gradle wrappers. Note that there are no tests (other than the one I pulled in from the src directory that the Initializr created).
2019-11-01 10:13:20 +00:00

32 lines
819 B
Java

package com.example.consumingwebservice;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import com.example.consumingwebservice.wsdl.GetCountryResponse;
@SpringBootApplication
public class ConsumingWebServiceApplication {
public static void main(String[] args) {
SpringApplication.run(ConsumingWebServiceApplication.class, args);
}
@Bean
CommandLineRunner lookup(CountryClient quoteClient) {
return args -> {
String country = "Spain";
if (args.length > 0) {
country = args[0];
}
GetCountryResponse response = quoteClient.getCountry(country);
System.err.println(response.getCountry().getCurrency());
};
}
}