aassif wrote:
>
> Now moving to the Server side implementation, I was expecting retrieving
> the result will be simple so I tried on the lines similar to Axis 1.X,
> below is the code listing:
>
> [znip code]
>
I don't know which is the preferred procedure for extracting authentication
data from incoming SOAP requests. I ended up acquiring the Principal object
(created by the servlet container upon a successful login since I let the
container handle the authentication) from the HTTP request. But then -
platform differences might come into play here. (As stated earlier, I use
OC4J 10.1.3.1.2.)
Here's an example of Principal extraction from the request:
//
:
import java.security.Principal;
import javax.servlet.http.HttpServletRequest;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.transport.http.HTTPConstants;
:
:
// acquire the active MessageContext
MessageContext mc = MessageContext.getCurrentMessageContext();
// acquire the active HTTP Request
HttpServletRequest req = (HttpServletRequest)
mc.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
Principal principal = req.getUserPrincipal();
if (principal == null) {
System.out.println("HTTP Request held no principal - user is not
logged in.");
} else {
System.out.println("UserName: " + principal.getName());
}
//
Sincerely,
Geir
--
View this message in context:
http://www.nabble.com/AXIS2-1.1.1-problem-with-BASIC-AUTH-tf3559184.html#a10159661
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]