How can i get raw Inputstream response from JAX-WS

2019-08-14 17:41发布

问题:

I've got an a client for JAX-WS webservice. The problem that i faced is the exception Unmarshalling Error: Maximum Number of Child Elements limit (50000) Exceeded when response is mapping to Java Objects. So i think about manually SAX parsing response. Is there any kind of hack/interceptor that allows me to use nice JAX-WS method binding with manually SAX parsing(through InputStream) the response?

回答1:

Actually there's no need to do that, since you can just override the property

 org.apache.cxf.stax.maxChildElements

to get rid of the exception. For more information, check it out the official documentation: http://cxf.apache.org/docs/security.html