jax-ws webmethod response - encode special characters

为君一笑 提交于 2019-12-13 04:48:05

问题


one of my jax-ws webmethods returns hash - string with special characters.

I am getting incomplete response XML.

When I return normal string e.g. "TEST", webmethod works ok.

How to encode the response? I hope j2ee5.0, jdk6.0 libraries are sufficient.

Thank you for response.


回答1:


Important in java class is:

@XmlElementRef(name = "Hash", type = JAXBElement.class)
@XmlMixed
protected List<Serializable> content;

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


来源:https://stackoverflow.com/questions/13077853/jax-ws-webmethod-response-encode-special-characters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!