WebSphere WebSphere Application Server Network Deployment, Version 6.0.x Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Invoking a password-protected outbound service

Invoke a password-protected external Web service by configuring and deploying a JAX-RPC handler to set the associated user ID and password.

Providers of external Web services can use HTTP basic authentication to secure their services. When you configure an outbound service to invoke an external Web service that requires HTTP basic authentication, you configure and deploy a JAX-RPC handler at the outbound port to provide the required user ID and password in the form of an HTTP Basic Authentication header. To configure and deploy this handler, complete the following steps:
  1. Create a new JAX-RPC handler class that sets the properties javax.xml.rpc.security.auth.username and javax.xml.rpc.security.auth.password. For example:
    public class BasicAuthHandler extends GenericHandler {
    
        public QName[] getHeaders() {
            return null;
        }
    
        public boolean handleRequest(MessageContext mc) {
            
            // Insert basic auth properties
            mc.setProperty("javax.xml.rpc.security.auth.username", "bob");
            mc.setProperty("javax.xml.rpc.security.auth.password", "xy129bge");
            return super.handleRequest(mc);
        }
    }
  2. Create a new JAX-RPC handler configuration for the handler.
  3. Create a new JAX-RPC handler list, then select the handler that sets the HTTP basic authentication properties for this service and add it to the handler list.
  4. Use the instructions given in Modifying an existing outbound service configuration to navigate to the administrative console page Service integration > Buses > [Content Pane] bus_name > Outbound Services > [Content Pane] service_name > Outbound Ports > [Content Pane] port_name, where service and port indicate the outbound port at which you apply the HTTP basic authentication properties.
  5. Set the JAX-RPC Handler list property by selecting, from the selection list, the handler list that sets the HTTP basic authentication properties for this service.
  6. Save your changes to the master configuration.
Related tasks
Password-protecting inbound services
Password-protecting a Web service operation
Accessing a password-protected proxy server

Task topic

Terms of Use | Feedback

Last updated: 5 Oct 2005
http://publib.boulder.ibm.com/infocenter/ws60help/index.jsp?topic=/com.ibm.websphere.pmc.nd.doc\tasks\tjw_security_out.html

© Copyright IBM Corporation 2004, 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)