I am implementing many JAX-WS web services with a common Handler class to validate the correct structure of incoming SOAP messages.
Is there some way to obtain the URL to which is directed the current message so i could get the schema from this url automatically and get the message validated?
In my application smc.get(JAXWSProperties.HTTP_REQUEST_URL)
returns null.
I've fount another way, I hope this helps:
public class HeaderHandler implements SOAPHandler<SOAPMessageContext> {
public boolean handleMessage(SOAPMessageContext smc) {
String endpointAddress = (String) smc.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
log.debug("endpointAddress " +endpointAddress);
}
}
Found!!!
public class HeaderHandler implements SOAPHandler<SOAPMessageContext> {
public boolean handleMessage(SOAPMessageContext smc) {
System.out.println("URL of Endpoint" +smc.get(JAXWSProperties.HTTP_REQUEST_URL));
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With