Created
May 28, 2017 20:34
-
-
Save marco-mendes/0127cd8f3601da2ef592b0448e412094 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Endpoint | |
public class CountryEndpoint { | |
private static final String NAMESPACE_URI = "http://spring.io/guides/gs-producing-web-service"; | |
private CountryRepository countryRepository; | |
@Autowired | |
public CountryEndpoint(CountryRepository countryRepository) { | |
this.countryRepository = countryRepository; | |
} | |
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "getCountryRequest") | |
@ResponsePayload | |
public GetCountryResponse getCountry(@RequestPayload GetCountryRequest request) { | |
GetCountryResponse response = new GetCountryResponse(); | |
response.setCountry(countryRepository.findCountry(request.getName())); | |
return response; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment