我有一个JBoss Web服务这样的:自定义401错误的Web服务(JBoss的)
@Stateless
@SecurityDomain("SecurityDomain")
@RolesAllowed("RolesAllowed")
@WebContext(urlPattern = "/*", authMethod = "BASIC", secureWSDLAccess = true)
@EndpointConfig(configName = "Standard WSSecurity Endpoint")
@WebService(name = "WebServiceName", targetNamespace = "http://webserviceName")
当调用此WebService与错误的凭据i'm收到以下错误:
<html>
<head>
<title>JBoss Web/2.1.3.GA - Error report</title>
<style>
<!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font- size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font- size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font- family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}
A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head>
<body><h1>HTTP Status 401 - </h1><HR size="1" noshade="noshade">
<p><b>type</b> Status report</p>
<p><b>message</b> <u></u></p>
<p><b>description</b> <u>This request requires HTTP authentication().</u></p>
<HR size="1" noshade="noshade"><h3>JBoss Web/2.1.3.GA</h3>
</body>
</html>
我想知道是否有办法定制这个401响应?
请注意,我的web服务工作正常(我的问题只在这个定制)。
非常感谢。
我发现了一些非常类似于我在这个链接中的东西:https://community.jboss.org/thread/80628?tstart = 0 ...但是这对JBoss(本机)web服务无效。 – JMarques 2012-05-02 17:55:22