title: CXF - Jaxws issue in Jboss AS 7: org.apache.cxf.staxutils.DepthExceededStaxException: reach the innerElementCountThreshold:50000
body: <p>I am facing an exception in Jaxws client while processing a SOAP webservice response, which is huge. This was working perfectly in Jboss 5.1. But I upgraded the Jboss to AS 7 and started getting below error.</p>
  
  <pre><code>Caused by: javax.xml.ws.soap.SOAPFaultException: reach the innerElementCountThreshold:50000
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:157)
      at com.sun.proxy.$Proxy41.getAllJobHistory(Unknown Source)
      at com.ep.service.impl.StatusSearchServiceImpl.findAll(StatusSearchServiceImpl.java:38) [classes:]
      at com.ep.controller.StatusBean.retrieveHistoryList(StatusBean.java:145) [classes:]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_45]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_45]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_45]
      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_45]
      at org.apache.el.parser.AstValue.invoke(AstValue.java:258) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
      at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
      at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68) [jsf-facelets-1.1.15.jar:1.1.15]
      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88) [jsf-api-1.2_15-b01-redhat-3.jar:1.2_15-b01-redhat-3]
      ... 31 more
  Caused by: org.apache.cxf.staxutils.DepthExceededStaxException: reach the innerElementCountThreshold:50000
      at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1199)
      at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1129)
      at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessage(SAAJInInterceptor.java:223)
      at org.apache.cxf.jaxws.handler.soap.SOAPMessageContextImpl.getMessage(SOAPMessageContextImpl.java:78)
      at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.createProtocolMessageContext(SOAPHandlerInterceptor.java:257)
      at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessageInternal(SOAPHandlerInterceptor.java:161)
      at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:124)
      at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:71)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
      at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:800)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1704)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1537)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1445)
      at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
      at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:660)
      at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
      at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
      at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
  </code></pre>
  
  <p>Is there a way to increase the response threshold in client initialization? I tried below logic and didn't work. Appreciate your help.</p>
  
  <pre><code>  BindingProvider.getRequestContext().put("org.apache.cxf.stax.maxChildElements", -1);
  </code></pre>