Reputation: 91
I encountered the following error:
java.util.concurrent.ExecutionException: javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: Text size limit (134217728) exceeded
It's simply says that there's max text size limitation via SOAP web service. According to the Securing CXF Services documentation, it's possible to define the following property in the CXF.xml file:
org.apache.cxf.stax.maxTextLength
My question is how to do it? Where in the file should write it?
I'm new to Java, thank you for help
Upvotes: 5
Views: 4591
Reputation: 1416
I faced this problem working with mule webservice cxf. The solution is increase values inside {MULE_HOME}/conf/wrapper.conf to value 268435456 = 256MB
wrapper.java.additional.20="-Dorg.apache.cxf.stax.maxTextLength=268435456"
wrapper.java.additional.20.stripquotes=TRUE
wrapper.java.additional.21="-Dcom.ctc.wstx.maxTextLength=268435456"
wrapper.java.additional.21.stripquotes=TRUE
Upvotes: 0
Reputation: 513
Maybe it's too late ... :)
For me, this worked on JBoss EAP 6.4 :
First, create a file nammed webservice-conf.xml into WEB-INF/ :
<?xml version="1.0" encoding="UTF-8"?>
<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0 schema/jbossws-jaxws-config_4_0.xsd">
<endpoint-config>
<config-name>Sample</config-name>
<property>
<property-name>org.apache.cxf.stax.maxTextLength</property-name>
<property-value>268435456</property-value>
</property>
</endpoint-config>
</jaxws-config>
You can specify the maximum size by setting the property value of org.apache.cxf.stax.maxTextLength , it's in bytes.
Then, on your web service implementation, add the @EndpointConfig annotation :
@WebService
@EndpointConfig(configName = "Sample", configFile = "WEB-INF/webservice-conf.xml")
public class SampleService implements ISampleService {
}
Please note that configName value in the annotation must match with config-name in the XML file.
It's worked for me
Upvotes: 1