Deploy and Security about WS on Tomcat

本文深入探讨了在web.xml中配置JAX-WS Web服务的两种方式:使用WSServlet和WSServletContainerListener,并解释了如何通过sun-jaxws.xml文件连接服务实现类与Web服务实例之间的联系。同时,文章还介绍了应用管理和容器管理认证的概念,以及Tomcat提供的五种认证插件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. in web.xml, there are two classes of JAX-WS: WSServlet and WSServletContainerListener

 

 

<listener>

<listener-class>

com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>

</listener>

<servlet>

<servlet-name>ladss</servlet-name>

<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>

</servlet>

 

<servlet-mapping>

<servlet-name>ladss</servlet-name>

<url-pattern>/test</url-pattern>

</servlet-mapping>

 

 

Please be advised that  one WSServlet could be mapped more than one WS instances. 

 

A WSServletContainerListener instance will parse a second (次要的,附加的), sun-specific configuration file named sun-jaxws.xml which provides the web service's endpoint by connecting the WSServlet instance to the service's implementation class.Here is the sun-jaxws.xml file:

 

<?xml version="1.0" encoding="UTF-8"?>

<endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" version="2.0">

    <endpoint

     name="test"

     implementation="hello.CircleFunctions"

     url-pattern="/test">         

     </endpoint>   

</endpoints> 

 

 

Security: Application-managed authentication  &  Container -managed authentication

 

a. Application-managed authentication

b. Container-managed authentication

Because Tomcat provides the concept 'Realm'  [relm] that plays a central role. A realm is a collection of  resources, including web pages and web services, with a designed authentication and authorization facility. Tomcat provides five plugins:

1. JDBC

2.DataSource

3. JNDI (the authentication information is stored in an LDAP-based lightweight directory access protocol) directory service, which is available through a JNDI provider.

4.Memory Realm, the authentication info is read into the container at startup from the file conf/tomcat-user/xml. this is the simplest choice and the default.

5.JAAS the authentication information is available (Java authentication & authorization service) provider, which in turn is available in a Java applicaiton server such as BEA, weblogic, glassfish, Jboss.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值