基于容器的身份验证在tomcat 7.0中不起作用
我在笔记本电脑中安装了Tomcat7.0和ApacheAxis2。我已经部署了 一个简单的基于SOAP的web服务。Web服务部署成功,并且日志文件中没有错误,并且获得了成功消息。 当我尝试实现基于Tomcat容器的身份验证时(基本) 使用web.xml时,它不起作用。lib文件夹中存在所有正确的库 我的web.xml条目如下所示。基于容器的身份验证在tomcat 7.0中不起作用,tomcat,Tomcat,我在笔记本电脑中安装了Tomcat7.0和ApacheAxis2。我已经部署了 一个简单的基于SOAP的web服务。Web服务部署成功,并且日志文件中没有错误,并且获得了成功消息。 当我尝试实现基于Tomcat容器的身份验证时(基本) 使用web.xml时,它不起作用。lib文件夹中存在所有正确的库 我的web.xml条目如下所示。 普通操作员用户 操作人员 操作员角色安全 /服务/* 操作人员 没有一个 基本的 操作人员 com.kathy.ws.UserProfile /服务/* ----
普通操作员用户
操作人员
操作员角色安全
/服务/*
操作人员
没有一个
基本的
操作人员
com.kathy.ws.UserProfile
/服务/*
----------------------------------------tomcat users.xml--------
-------------------------sun-jaxws.xml
您收到了什么错误?我没有收到任何错误。它不是UserProfileImpl->UserProfileNo errors in log files。UserProfile你好,这是AXIS服务!也许这里会有一个调用服务的表单…当我打开浏览器时,localhost:8080/security test/services/UserProfile-->axis2会像上面一样弹出成功消息。您得到了什么错误?我没有得到任何错误。它不是UserProfileImpl->UserProfileNo errors in log file。UserProfile你好,这是AXIS服务!也许这里会有一个调用服务的表单…当我打开浏览器时,localhost:8080/security test/services/UserProfile-->axis2会像上面一样弹出成功消息。您得到了什么错误?我没有得到任何错误。它不是UserProfileImpl->UserProfileNo errors in log file。UserProfile你好,这是AXIS服务!当我打开浏览器,localhost:8080/security test/services/UserProfile-->axis2弹出成功消息时,这里可能会有一个调用服务的表单,如上所述。
<security-role>
<description>Normal operator user</description>
<role-name>operator</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>Operator Roles Security</web-resource-name>
<url-pattern>/services/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>operator</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<role-name>operator</role-name>
</login-config>
<servlet-mapping>
<servlet-name>com.kathy.ws.UserProfile</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
----------------------------------------tomcat users.xml--------
<role rolename="tomcat"/>
<role rolename="operator"/>
<user username="tomcat" password="welcome1" roles="tomcat"/>
<user username="both" password="welcome1" roles="tomcat,operator"/>
<user username="operator" password="welcome1" roles="operator"/>
-------------------------sun-jaxws.xml
<?xml version="1.0" encoding="UTF-8"?>
<endpoints
xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime"
version="2.0">
<endpoint
name="UserProfileImpl"
implementation="com.kathy.ws.UserProfile"
url-pattern="/services/UserProfile"/>
</endpoint>
</endpoints>