First look at the previous example: http://blog.csdn.net/kunshan_shenbin/archive/2009/01/17/3813000.aspx
This example can run normally, even if you use Chinese characters, for example:
Modify the test code: sayhiservicetest. Java
Package COM. service. test; </P> <p> Import static Org. JUnit. assert. *; <br/> Import Org. JUnit. beforeclass; <br/> Import Org. JUnit. test; <br/> Import Org. springframework. context. applicationcontext; <br/> Import Org. springframework. context. support. classpathxmlapplicationcontext; </P> <p> Import COM. cecltd. service. sayhisrvc; </P> <p> public class sayhiservicetest {</P> <p> Private Static sayhisrvc; </P> <p> @ Be Foreclass <br/> Public static void setup () {</P> <p> applicationcontext context = new classpathxmlapplicationcontext (New String [] {"applicationcontext. XML "}); <br/> sayhisrvc = (sayhisrvc) context. getbean ("sayhisrvc"); <br/>}</P> <p> @ test <br/> Public void testsayhi () {</P> <p> assertequals ("Hi, shenbin! ", Sayhisrvc. sayhi (" shenbin "); <br/> assertequals (" Hi, China! ", Sayhisrvc. sayhi (" China "); <br/>}< br/>}
A red light is displayed after running:
It can be seen that when JUnit is used for testing through ws encryption and decryption, some Chinese characters (some Chinese characters can be passed well during the actual test) cannot be returned normally.
Of course, we can see from the texture at the beginning of this article that there is no problem with client access.
After some research, found that as long as the xmlsec-1.4.0.jar to replace the xmlsec-1.3.0.jar can solve this problem, does this is a bug in the work?
XML security official home: http://santuario.apache.org/
2009.03.09 append ---->
Practice has proved that the xmlsec-1.4.1.jar version is also normal, let's look at the differences between these three versions of a source file:
Version 1.3.0:
Version 1.4.0:
Version 1.4.1:
There may be bugs in version 1.4.0!