The following sub-web.xml example shows how to use the server.xml message security provider provider1 in a web application.
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 2006-2007 Sun Microsystems,Inc. All rights reserved. Use is subject to license terms. --> <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc. //DTD Application Server 8.1 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd"> <sun-web-app> <context-root>/jaxws-fromwsdl-soap12</context-root> <servlet> <servlet-name>fromwsdl</servlet-name> <webservices-endpoint> <port-component-name>fromwsdl-soap12</port-component-name> <message-security-binding auth-layer="SOAP" <provider-id>provider1</provider-id> </message-security-binding> </webservices-endpoint> </servlet> </sun-web-app>
The port-component-name element should be the same as the name attribute in the endpoint element in sun-jaxws.xml. If the provider-id element is not specified in sun-web.xml, then the default-soap-auth-provider-name configured in server.xml is be used as the provider.
Deploy the sample web application fromwsdl-soap12.war on to the Web Server.