问题描述
woodstox-core-asl-4.2.0.jar包有,stax2-api-3.1.4.jar也有,cxf-2.7.12.jar包等debug跟踪了代码,客户端调用的接口,服务器也响应了,安全认证中这段SOAPMessagemess=message.getContent(SOAPMessage.class);if(mess==null){saaIn.handleFault(message);mess=message.getContent(SOAPMessage.class);}mess一直都是空的,不知道什么原因,所以改成了List<Header>headers=message.getHeaders();可以取到客户端发的认证信息
服务端的函数也运行了,方法也return了return完之后,客户端就报错Exceptioninthread"main"javax.xml.ws.soap.SOAPFaultException:CannotcreateasecureXMLInputFactoryatorg.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:158)at$Proxy41.test(UnknownSource)atTest.main(Test.java:97)Causedby:java.lang.RuntimeException:CannotcreateasecureXMLInputFactoryatorg.apache.cxf.staxutils.StaxUtils.createXMLInputFactory(StaxUtils.java:314)客户端配置XML:<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:jaxws="http://cxf.apache.org/jaxws"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.0.xsdhttp://cxf.apache.org/jaxwshttp://cxf.apache.org/schemas/jaxws.xsd"><!--客户端调用--><jaxws:clientid="serviceClient"serviceClass="com.sinitech.zs.dataprovide.webservice.ZSBusinessWebServiceI"address="http://127.0.0.1:8081/zs/webservice/zsbusiness?wsdl"><!--客户端outInterceptor服务器端inInterceptor--><jaxws:outInterceptors><refbean="mySoapAuth"/></jaxws:outInterceptors></jaxws:client><beanid="mySoapAuth"class="zswebserviceclient.soap.ClientSoap"></bean></beans>
服务端xml配置:<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:jaxws="http://cxf.apache.org/jaxws"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://cxf.apache.org/jaxwshttp://cxf.apache.org/schemas/jaxws.xsd"><importresource="classpath:META-INF/cxf/cxf.xml"/><importresource="classpath:META-INF/cxf/cxf-extension-soap.xml"/><importresource="classpath:META-INF/cxf/cxf-servlet.xml"/><jaxws:endpointid="zsbusinesswebservice"implementor="com.sinitech.zs.dataProvide.webservice.ZSBusinessWebServiceImpl"address="/zsbusiness"><!--安全认证--><jaxws:inInterceptors><refbean="soapAuth"/></jaxws:inInterceptors></jaxws:endpoint><!--安全认证类--><beanid="soapAuth"class="com.sinitech.zs.dataProvide.webservice.SOAPAuthIntercepter"><propertyname="systemid"value="123"></property><propertyname="userid"value="uuu"></property><propertyname="password"value="ddd"></property><propertyname="localPart"value="RequestSOAPHeader"></property><propertyname="namespaceURI"value="http://webservice.dataProvide.zs.sinitech.com"></property></bean></beans>
求大神们指导指导
解决方案
解决方案二:
大神都快来看看啊