Now redeploy the MySecureWebServiceClientEar. If it goes right, your browser will prompt for a username and password when you access the test client page. When we hit the web service, we get our response as expected. Authentication is in place!

By adding
   
@Resource     WebServiceContext context;
to the web service implementation, we can have access to the context, which will hold the userprinciple.
(I also needed to add the @WebService annotation to the class, otherwise the @Resource did not get injected, and context was null)
@WebService   public class MyWebServiceImpl
We will add this line to our implementation:
System.out.println("MyWebService was called by " + context.getUserPrincipal());
If we login to the test client page with wasadmin, we expect the line "MyWebService was called by wasadmin". After all, we authenticated with wasadmin, right? However, it prints "MyWebService was called by null".

The Caller



The reason why the principal is null, is because we did not specify the Caller in the provider binding. This caller entry tells the appserver which
token should be used for the java security in the application itself. By setting the ltpa token our caller, we can propagate the user identity.
To set the caller, goto Services > Policy sets > General provider policy set bindings , and click on the "Provider sample" binding.
Remember that we used this default policy set binding for our sample. Click on the policy WS-Security, and click Caller:

Position: Web Developer (w/ Mobile) Location: King of Prussia Status: Freelance to Full Time Starts: ASAP Rate: Up to $120k DOE Our client, an interactive agency just north of the city, needs an onsite Web Developer with Mobile experience to join their team. You will be a member of a cross functional team responsible for building the presentation layer for web applications, including both e-commerce and marketing web sites for leading retailers and brands. You must have 3-5 years experience working as a part of development technology team, with recent web + mobile samples to support your work. The primary focus will be on front-end technologies, however the ability to work on back-end components like content management systems is greatly desired. Also desired is prior experience working in an interactive agency environment, as well as experience with e-commerce. You must be proficient in HTML5, CSS, PHP, JavaScript. Must have familiarity working with legacy code as this will be a primary focus. SAMPLES ARE A MUST! This is 3 months to start with a VERY strong chance of going full-time! If you feel you are qualified for this position please send your resume and samples to: View additional job opportunities at www.creativecircle.com