Java Code Examples for javax.xml.ws.WebServiceContext#getUserPrincipal()

The following examples show how to use javax.xml.ws.WebServiceContext#getUserPrincipal() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GreeterImpl.java    From cxf with Apache License 2.0 5 votes vote down vote up
public String greetMe(String me) {
    WebServiceContext ctx = super.getContext();
    Principal p = ctx.getUserPrincipal();
    if (p != null) {
        user = p;
    }

    //System.out.println("\n\n*** GreetMe called with: " + me + "***\n\n");
    return "Hello " + me;
}
 
Example 2
Source File: GreeterImpl.java    From cxf with Apache License 2.0 5 votes vote down vote up
public String sayHi() {
    WebServiceContext ctx = super.getContext();
    Principal p = ctx.getUserPrincipal();
    if (p != null) {
        user = p;
    }
    return super.sayHi();
}