zerocool
zerocool

Reputation: 103

SoapHeader and problems with non-unicode characters

I created

public class ExceptionHandler implements SOAPHandler<SOAPMessageContext>

I want to create soap header with non-ascii characters.

MessageFactory factory = MessageFactory.newInstance();
SOAPMessage soapMsg = factory.createMessage();
//soapMsg.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, "utf-8");
SOAPHeaderElement aaa = soapMsg.getSOAPHeader().addHeaderElement(new QName("test", "aaa"));
aaa.addTextNode("ść");
context.setMessage(soapMsg);

What i get in response is:

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
   <env:Header>
       <aaa xmlns="test">ść</aaa>
   </env:Header>
   <env:Body/>
</env:Envelope>

Does this api do not support nonascii characters or is it a bug?

Upvotes: 0

Views: 149

Answers (0)

Related Questions