how to set up endpoint for my soap webservice?

hey guys. im trying to make my own soap webservice, and im following official spring guide. and i have question about the endpoint. i have this:
@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;
    }
}

1. why do i need namespace uri? and what the does it even mean?
2. how does PayloadRoot annotation work? what do i need to use in localpart?
3. in my xsd file, what to use for xmlns:tns tag and for targetNamespace tag?

thanks in avdance.
Was this page helpful?