Reputation: 330
I have a class annotated with @Endpoint and a handler method
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "getWeatherRequest")
@SoapAction("http://foo/domain/getWeatherRequest")
@ResponsePayload
public GetWeatherResponse getWeatherRequest(@RequestPayload GetWeatherRequest request) {
// I want to get HTTP header (Not SOAP Header) here
}
Upvotes: 0
Views: 647
Reputation: 3818
You can use RequestHeader
annotation in your method to access http headers, you can specify whether header is mandatory or optional using required
attribute
@RequestHeader(value = "ConfigId", required = true) String configId
Upvotes: 0
Reputation: 4450
Try using the @RequestHeader annotation
@SoapAction("http://foo/domain/getWeatherRequest")
@ResponsePayload
public GetWeatherResponse getWeatherRequest(@RequestPayload GetWeatherRequest request,
@RequestHeader("header-name") String header) {
}
Upvotes: 1