{"id":6532,"date":"2014-04-20T08:17:15","date_gmt":"2014-04-20T08:17:15","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/20\/jaxws-org-apache-cxf-binding-soap-soapfault-error-writing-to-xmlstreamwriter-collection-of-common-programming-errors-2\/"},"modified":"2014-04-20T08:17:15","modified_gmt":"2014-04-20T08:17:15","slug":"jaxws-org-apache-cxf-binding-soap-soapfault-error-writing-to-xmlstreamwriter-collection-of-common-programming-errors-2","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/20\/jaxws-org-apache-cxf-binding-soap-soapfault-error-writing-to-xmlstreamwriter-collection-of-common-programming-errors-2\/","title":{"rendered":"JAXWS : org.apache.cxf.binding.soap.SoapFault: Error writing to XMLStreamWriter-Collection of common programming errors"},"content":{"rendered":"<p>I am trying to access my server (webservice exposed using CXF) using spring JAX WS client. Both server and client are running locally on my machine. However when my client code tries to access a webservice, I am getting exception on server:<\/p>\n<pre><code>org.apache.cxf.binding.soap.SoapFault: Error writing to XMLStreamWriter.\nat org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:288)\nat org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:270)\nat org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)\nat org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:111)\nat org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:323)\nat org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)\nat org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:232)\nat org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:209)\nat org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:191)\nat org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:114)\nat org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)\nat org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:113)\nat javax.servlet.http.HttpServlet.service(HttpServlet.java:707)\n.\n.\n.\nCaused by: com.ctc.wstx.exc.WstxIOException: null\nat com.ctc.wstx.sw.BaseStreamWriter._finishDocument(BaseStreamWriter.java:1406)\n    at com.ctc.wstx.sw.BaseStreamWriter.writeEndDocument(BaseStreamWriter.java:536)\n    at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:282)\n    ... 38 more\nCaused by: org.eclipse.jetty.io.EofException\nat org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:148)\nat org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:92)\nat org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:46)\nat com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:100)\nat com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:225)\nat com.ctc.wstx.sw.BufferingXmlWriter.close(BufferingXmlWriter.java:198)\nat com.ctc.wstx.sw.BaseStreamWriter._finishDocument(BaseStreamWriter.java:1404)\n    ... 40 more\n<\/code><\/pre>\n<p>And at client side, i am getting<\/p>\n<pre><code>2013-10-15 17:15:42,173 [ERROR] [org.apache.jsp.WEB_002dINF.views._500_jsp] [app=pehz] [guid=deadbeef-23c1-45bc-2b2-5d2986eb915b] [remote=127.0.0.1] - Uncaught Exception, got caught by SPRING context!  User: test\njavax.xml.ws.WebServiceException: java.io.IOException: Premature EOF\nat com.sun.xml.internal.ws.streaming.TidyXMLStreamReader.close(TidyXMLStreamReader.java:58)\nat com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:351)\nat com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseImport(RuntimeWSDLParser.java:301)\nat com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseImport(RuntimeWSDLParser.java:677)\nat com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:336)\nat com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:157)\nat com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:120)\nat com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:257)\nat com.sun.xml.internal.ws.client.WSServiceDelegate.(WSServiceDelegate.java:220)\nat com.sun.xml.internal.ws.client.WSServiceDelegate.(WSServiceDelegate.java:168)\nat com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:96)\nat javax.xml.ws.Service.(Service.java:77)\nat javax.xml.ws.Service.create(Service.java:707)\nat org.springframework.remoting.jaxws.LocalJaxWsServiceFactory.createJaxWsService(LocalJaxWsServiceFactory.java:125)\nat org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.prepare(JaxWsPortClientInterceptor.java:334)\n.\n.\n.\nCaused by: java.io.IOException: Premature EOF\nat sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:565)\nat sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:609)\nat sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:696)\nat java.io.FilterInputStream.read(FilterInputStream.java:133)\nat sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3052)\nat java.io.FilterInputStream.read(FilterInputStream.java:133)\nat java.io.FilterInputStream.read(FilterInputStream.java:107)\nat com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser$1.close(RuntimeWSDLParser.java:835)\nat com.sun.xml.internal.ws.streaming.TidyXMLStreamReader.close(TidyXMLStreamReader.java:56)\n... 108 more\n<\/code><\/pre>\n<p>Can you please help what this error is all about and how to resolve the same.<\/p>\n<p>Thanks<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am trying to access my server (webservice exposed using CXF) using spring JAX WS client. Both server and client are running locally on my machine. However when my client code tries to access a webservice, I am getting exception on server: org.apache.cxf.binding.soap.SoapFault: Error writing to XMLStreamWriter. at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:288) at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:270) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:111) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6532","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6532"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6532\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}