public interface WebServiceContext
WebServiceContext
使得Web服务端点实现类来访问消息上下文相关的信息服务和安全要求。一个典型的
WebServiceContext
注入一个端点实现类使用
Resource
注释。
Resource
Modifier and Type | Method and Description |
---|---|
<T extends EndpointReference> |
getEndpointReference(类<T> clazz, Element... referenceParameters)
返回与此相关的
EndpointReference 端点。
|
EndpointReference |
getEndpointReference(Element... referenceParameters)
返回此端点的
EndpointReference 。
|
MessageContext |
getMessageContext()
返回请求服务时,这种方法被称为
MessageContext 。
|
Principal |
getUserPrincipal()
返回当前正在服务的请求的发送者的主体。
|
boolean |
isUserInRole(String role)
返回一个布尔值,指示是否包含已验证的用户是否包含在指定的逻辑角色中。
|
MessageContext getMessageContext()
MessageContext
。只有应用程序范围的属性将在应用程序中可见。
IllegalStateException
这个例外是如果方法没有要求为服务称扔。
MessageContext
,
MessageContext.Scope
,
IllegalStateException
Principal getUserPrincipal()
null
。
IllegalStateException
这个例外是如果方法没有要求为服务称扔。
Principal
,
IllegalStateException
boolean isUserInRole(String role)
false
。
role
-
String
指定角色的名字
boolean
指示请求的发送者属于给定的角色
IllegalStateException
这个例外是如果方法没有要求为服务称扔。
EndpointReference getEndpointReference(Element... referenceParameters)
EndpointReference
。
如果这bindingProvider
的Binding
是soap1.1/http或soap1.2/http,然后W3CEndpointReference
必须返回。
referenceParameters
参考参数和返回
EndpointReference
实例关联。
WebServiceContext
。如果返回类型是
EndpointReference
W3CEndpointReference
那么它必须包含指定的
referenceParameters
。
IllegalStateException
这个例外是如果方法没有要求为服务称扔。
W3CEndpointReference
<T extends EndpointReference> T getEndpointReference(类<T> clazz, Element... referenceParameters)
EndpointReference
端点。
clazz
-
EndpointReference
类型必须返回。
referenceParameters
参考参数和返回
EndpointReference
实例关联。
WebServiceContext
实例关联的端点类型
clazz
EndpointReference。如果返回类型是
EndpointReference
W3CEndpointReference
那么它必须包含指定的
referenceParameters
。
IllegalStateException
这个例外是如果方法没有要求为服务称扔。
WebServiceException
-如果
EndpointReference
的
clazz
类型不支持。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.