The scenario: I want a SOAP web service GetStringService that will return a big XML string with MTOM.
I want to make sure the encoding stays the same from start to finish, because the XML document is really sensative of course to chars modified when encode/decode happens from other char sets.
Server: JBoss 6.1.0.Final
Attached to this article: cxf-test.war - example web app, and cxf-test-soapui-project.xml a soapui test case.
Here is the implementation of the web service:
(attached this code snippet as image to avoid the weird chars getting encoded)
Here is what I add to web.xml:
<servlet> | ||
<servlet-name>GetStringServiceServlet</servlet-name> | ||
<servlet-class>com.openlogic.GetStringServiceImpl</servlet-class> | ||
</servlet> | ||
<servlet-mapping> | ||
<servlet-name>GetStringServiceServlet</servlet-name> | ||
<url-pattern>/*</url-pattern> | ||
</servlet-mapping> |
This will deploy. The WSDL url will be: http://localhost:8080/cxf-test
Run this in soapui with the project attached:
This returns the XML with correct encoding:
So there you have it!
Comments