| Summary | This article clarifies a possible cause for a client to fails with org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog |
|---|---|
| Article Number | 34728 |
| Environment | Artix 5.6 JAX-WS All Supported Operating Systems |
| Question/Problem Description | Artix 5.6 JAX-WS client fails with org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog. |
| Clarifying Information | |
| Error Message | org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader. at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:222) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:785) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2375) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2233) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2076) at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47) at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:188) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:724) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInte rceptor.java:62) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:546) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:343) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:295) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog at [row,col {unknown-source}]: [1,0] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:677) at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2104) at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2010) at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1102) at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1125) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:122) ... 21 more |
| Defect/Enhancement Number | |
| Cause | The cause is a potential unhandled exception (e.g. a ClassCastException) on the server side, which causes an empty response to be sent back to the client. |
| Resolution | Enable SOAP message logging in Artix by using the org.apache.cxf.interceptor.LoggingOutInterceptor and the org.apache.cxf.interceptor.LoggingInInterceptor. Please see the Artix Java Runtime documentation for further details on configuring these interceptors. If the inbound message (response) contains "Response-Code: 200" and "Contenth-Length=[0]" this indicates that unhandled exception might have occured on the server side. INFO: Inbound Message
----------------------------
ID: 1
Response-Code: 200
Encoding: ISO-8859-1
Content-Type: text/plain
Headers: {connection=[Keep-Alive], Content-Language=[en-US], Content-Length=[0], content-type=[text/plain], Date=[Thu, 23 Aug
2012 21:54:57 GMT], Keep-Alive=[timeout=10, max=100]}
--------------------------------------
Check the server side log and ensure the server is handling exceptions correctly and returning well formated SOAP messages. |
| Workaround | |
| Notes | |
| Attachment |
| Created date: | 12 September 2012 |
|---|---|
| Last Modified: | 12 February 2013 |
| Last Published: | 12 September 2012 |
| First Published date: | 12 September 2012 |
#Orbix
#KnowledgeDocs