cxf客户端获取不到发布的服务xml报文 请大神指点

osc皮皮 发布于 2016/05/11 17:49
阅读 376
收藏 0

客户端代码             

public static void main(String[] args) throws Exception {  
            JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
            factory.setServiceClass(InterfaceFimsp.class);
            factory.setAddress("http://localhost:8081/EHR/ws/FimspService");
            InterfaceFimsp client = (InterfaceFimsp)factory.create();
            System.out.println(client.getProject("wew"));
         
            
        }

执行客户端代码报错:

五月 11, 2016 5:12:06 下午 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
信息: Creating Service {http://wsdl.framework.mpg.com/}InterfaceFimspService from class com.mpg.framework.wsdl.InterfaceFimsp
五月 11, 2016 5:12:07 下午 org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
警告: Interceptor for {http://wsdl.framework.mpg.com/}InterfaceFimspService#{http://wsdl.framework.mpg.com/}getProject has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:230)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:672)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2210)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2087)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1985)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:640)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:484)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:310)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:262)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
at com.sun.proxy.$Proxy45.getProject(Unknown Source)
at com.mpg.framework.wsdl.InterfaceServiceTest.main(InterfaceServiceTest.java:33)
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]

spring-cxf.xml配置文件

<bean id="InterfaceFimsp" class="com.mpg.framework.wsdl.impl.InterfaceServiceImpl" />

  <jaxws:endpoint id="fimspService" implementor="#InterfaceFimsp" address="/FimspService" /> 


http://localhost:8081/EHR/ws/FimspService?wsdl访问是正常的

如图:




加载中
返回顶部
顶部