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"
>