javajax-wsjava-metro-framework

Get Url of endpoint using on a handler (JAX-WS)


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?


Solution

  • Found!!!

    public class HeaderHandler implements SOAPHandler<SOAPMessageContext> {
    
    public boolean handleMessage(SOAPMessageContext smc) {
        System.out.println("URL of Endpoint" +smc.get(JAXWSProperties.HTTP_REQUEST_URL));
     }
    }