apache cxf interceptor pre
来源:互联网 发布:思科网络配置实例 编辑:程序博客网 时间:2024/04/29 22:30
public class PrivilegeInter extends AbstractPhaseInterceptor<Message>
{
private static final int MAXSUM = 10;
public static int getCOUNT() {
return COUNT;
}
public static void setCOUNT(int count) {
COUNT = count;
}
public static int getMAXSUM() {
return MAXSUM;
}
private static int COUNT = 0;
public PrivilegeInter() {
super(Phase.PRE_STREAM);
// TODO Auto-generated constructor stub
}
public void handleMessage(Message outMessage) throws Fault
{
COUNT++;
if (COUNT > MAXSUM)
{
System.out.println("return");
return;
}
System.out.println(COUNT);
System.out.println(outMessage.getExchange().getDestination().getAddress());
Map<String, List<String>> headers = (Map<String, List<String>>)outMessage.get(Message.PROTOCOL_HEADERS);
String s = (String)outMessage.get(Message.BASE_PATH);
System.out.println(s);
String s1 = (String)outMessage.get(Message.HTTP_REQUEST_METHOD);
System.out.println(s1);
String s2 = (String)outMessage.get(Message.PATH_INFO);
System.out.println(s2);
String s3 = (String)outMessage.get(Message.REQUEST_URI);
System.out.println(s3);
String s4 = (String)outMessage.get(Message.QUERY_STRING);
System.out.println(s4);
}
}
=========================================
public class PrivilegeOuter extends AbstractPhaseInterceptor<Message>
{
public PrivilegeOuter() {
super(Phase.POST_STREAM);
// TODO Auto-generated constructor stub
}
public void handleMessage(Message arg0) throws Fault
{
PrivilegeInter.setCOUNT(PrivilegeInter.getCOUNT() - 1);
System.out.println(PrivilegeInter.getCOUNT());
}
}
========================
<jaxrs:server id="pervice" address="/">
<jaxrs:serviceBeans>
<ref bean="privilegeServiceImpl" />
</jaxrs:serviceBeans>
<jaxrs:inInterceptors>
<ref bean="inter" />
</jaxrs:inInterceptors>
<jaxrs:outInterceptors>
<ref bean="outer" />
</jaxrs:outInterceptors>
</jaxrs:server>
<bean id="inter" class="com..PrivilegeInter" />
<bean id="outer" class="com.PrivilegeOuter" />
- apache cxf interceptor pre
- org.apache.cxf.interceptor.Fault
- org.apache.cxf.interceptor.Fault: Unmarshalling Error:
- java cxf org.apache.cxf.interceptor.Fault: Unmarshalling Error: null
- java cxf org.apache.cxf.interceptor.Fault: Unmarshalling Error: null
- org.apache.cxf.interceptor.Fault: Unexpected wrapper element {****}
- org.apache.cxf.interceptor.Fault: Unmarshalling Error错误解决方案
- org.apache.cxf.interceptor.Fault: Unexpected wrapper element {****}
- org.apache.cxf.interceptor.Fault:Could not send Message
- org.apache.cxf.interceptor.Fault: No such operation
- Apache CXF拦截器Interceptor实现WebServices用户验证
- org/apache/cxf/interceptor/InterceptorProvider : Unsupported major.minor version 51.0
- apache cxf interceptor如何获取消息的详细内容
- Apache CXF拦截器Interceptor实现WebServices用户验证
- org.apache.cxf.interceptor.Fault: For input string: "null"
- cxf /webservice出错 org.apache.cxf.interceptor.Fault: No such operation: (HTTP GET PATH_INFO: /CxfDem
- org.apache.cxf.interceptor.Fault: Could not send Message.(CXF客户端访问服务器端出错)
- CXF中的Interceptor
- 社交新人十二招
- 程序员之家 http://www.cnblogs.com/
- hhh
- 《浮沉2》
- ril - 3
- apache cxf interceptor pre
- 蔡康永:哈佛的博士才自卑
- 道德本能
- Spring面试题
- boost::polymorphic_cast用法
- Android RIL 架构
- 老子孔子打架到底该帮谁
- c# winform如何连接oracle数据库?能不能举个例子?
- tomcat配置 https