当前位置: 代码迷 >> Web Service >> 客户端调用时header异常
  详细解决方案

客户端调用时header异常

热度:1333   发布时间:2016-05-02 03:11:35.0
客户端调用时header错误
搜索了一下: 
有说法是服务端 客户端时间不对 但是我都是本机 应该不存在这个问题
还有说法是jar冲突 因为我工程用的jar包比较多 也不清楚是哪个jar包导致的?

错误代码如下:
Java code
2011-11-21 16:45:07 org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor handleMessage警告: Request does not contain required Security header, but it's a fault.Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: An error was discovered processing the <wsse:Security> header    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)    at $Proxy33.proxyMethod(Unknown Source)    at client.SpringClient.main(SpringClient.java:32)Caused by: org.apache.cxf.binding.soap.SoapFault: An error was discovered processing the <wsse:Security> header    at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75)    at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)    at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)    at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:99)    at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)    at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2335)    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2193)    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2037)    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)    at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:697)    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)    ... 2 more


------解决方案--------------------
这个怎么看呢?

代码呢?
------解决方案--------------------
http://squallxun.blog.163.com/blog/static/2129901520083256204230/
------解决方案--------------------
重新添加相应的jar 包,试试
------解决方案--------------------
Request does not contain required Security header, but it's a fault.

服务端需要 一个 SoapHeader 做验证,你没有加。
------解决方案--------------------
java 是客户端吧。客户端没加的样子。
  相关解决方案