【发布时间】:2012-03-28 12:48:47
【问题描述】:
有没有办法操纵 jaxws 中使用的编组器。 我喜欢发送在 web 服务请求中提交的 cdata,为此我想尝试类似 describet 的操作:http://odedpeer.blogspot.de/2010/07/jaxb-sun-and-how-to-marshal-cdata.html
简而言之,他们这样做:
Marshaller m = JAXBContext.newInstance( Item.class ).createMarshaller();
m.setProperty( "com.sun.xml.internal.bind.characterEscapeHandler", new CharacterEscapeHandler() {
@Override
public void escape( char[] ac, int i, int j, boolean flag, Writer writer ) throws IOException
{
// do not escape
writer.write( ac, i, j );
}
});
jaxws 能以某种方式实现吗?
【问题讨论】: