jax-ws webmethod response - encode special charact

2019-09-09 05:02发布

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条回答
贪生不怕死
2楼-- · 2019-09-09 05:12

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"
                             >
查看更多
登录 后发表回答