Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 961
jesantana Avatar asked Dec 27 '13 10:12

jesantana


2 Answers

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);
    }
}
like image 149
fl4l Avatar answered Sep 28 '22 06:09

fl4l


Found!!!

public class HeaderHandler implements SOAPHandler<SOAPMessageContext> {

public boolean handleMessage(SOAPMessageContext smc) {
    System.out.println("URL of Endpoint" +smc.get(JAXWSProperties.HTTP_REQUEST_URL));
 }
}
like image 44
jesantana Avatar answered Sep 28 '22 06:09

jesantana