Я сделал конечную точку для своего приложения SOAP, и когда я сделал это:
@ResponsePayload
public GetCountryResponse getCountry(@ResponsePayload GetCountryRequest request) {
GetCountryResponse response = new GetCountryResponse();
response.setCountry(countryRepository.findCountry(request.getName()));
}
Этот второй @ResponsePayload в методе getCountry дает мне эту ошибку:
The annotation @ResponsePayload is disallowed for this location
В документе ResponsePayload мы можем найти ниже:
Annotation which indicates that a method return value should be bound to the response payload. Supported for annotated endpoint methods.
ТАК, используя @RequestPayload вместо @ResponsePayload
@ResponsePayload
public GetCountryResponse getCountry(@RequestPayload GetCountryRequest request) {
GetCountryResponse response = new GetCountryResponse();
response.setCountry(countryRepository.findCountry(request.getName()));
}
Более подробную информацию можно найти на ResponsePayload и RequestPayload
это аннотация
responseи не должна использоваться сrequest