webservice异常Fault occurred while processing的解决

在本地调用webService接口的时候报了javax.xml.ws.WebServiceException: org.apache.cxf.binding.soap.SoapFault: Fault occurred while processing.这个错误。(错误堆栈信息贴到文末尾)

本地调用接口的时候的参数中有很多参数是空的,

webservice异常Fault occurred while processing的解决_第1张图片

看到这些参数为为空,那么将这些参数替换为空字符串 "",

webservice异常Fault occurred while processing的解决_第2张图片

 

成功调用接口并获得数据

webservice异常Fault occurred while processing的解决_第3张图片

对于我这个方法的问题追踪最终的产生原因 ,是webservice服务端的处理中没有空从参数进行处理,也就是说这是服务端的问题,客户端可以使用替换null为空字符串的方法进行解决。

产生这个问题的原因可能不只是这一个并不只是这一个,还会有其他问题。

 

希望这个解决办法对你有帮助

 

 

错误堆栈信息

javax.xml.ws.WebServiceException: org.apache.cxf.binding.soap.SoapFault: Fault occurred while processing.
	at org.apache.cxf.jaxws.JaxWsClientProxy.mapException(JaxWsClientProxy.java:193)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:145)
	at com.sun.proxy.$Proxy192.contractQuery(Unknown Source)
	at com.zznode.ssp.webservice.client.scm.contractInfoQuery.BSSCMPO00012_BSSCMPO00012Port_Client.invokingService(BSSCMPO00012_BSSCMPO00012Port_Client.java:173)
	at com.zznode.ssp.webservice.client.scm.contractInfoQuery.BSSCMPO00012_BSSCMPO00012Port_Client.run(BSSCMPO00012_BSSCMPO00012Port_Client.java:266)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.apache.cxf.binding.soap.SoapFault: Fault occurred while processing.
	at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:87)
	at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:53)
	at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:42)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:112)
	at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:70)
	at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:35)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:826)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1693)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1570)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1371)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:671)
	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:531)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:440)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:355)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:140)
	... 4 more

 

 

参考博客连接:

https://blog.csdn.net/baohuan_love/article/details/14449559

https://blog.csdn.net/Rain_JN/article/details/78564029

 

你可能感兴趣的:(webservice异常Fault occurred while processing的解决)