jax-ws webmethod响应-编码特殊字符 [英] jax-ws webmethod response - encode special characters
本文介绍了jax-ws webmethod响应-编码特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的jax-ws网络方法之一返回哈希-具有特殊字符的字符串.
one of my jax-ws webmethods returns hash - string with special characters.
我收到的响应XML不完整.
I am getting incomplete response XML.
当我返回普通字符串时"TEST",网络方法正常.
When I return normal string e.g. "TEST", webmethod works ok.
如何对响应进行编码?我希望j2ee5.0,jdk6.0库足够.
How to encode the response? I hope j2ee5.0, jdk6.0 libraries are sufficient.
感谢您的回复.
推荐答案
在Java类中重要的是:
Important in java class is:
@XmlElementRef(name = "Hash", type = JAXBElement.class)
@XmlMixed
protected List<Serializable> content;
在xsd中,重要的是生成="true":
Important in xsd for generation is mixed="true":
<xsd:complexContent mixed="true">
<xsd:extension base="common:Request">
<xsd:sequence>
<xsd:element name="Hash"
type="xsd:string"
minOccurs="1"
maxOccurs="1"
>
这篇关于jax-ws webmethod响应-编码特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文