use of com.sun.xml.ws.developer.SerializationFeature in project metro-jax-ws by eclipse-ee4j.
the class EchoTest method testExceptionUtf8.
public void testExceptionUtf8() throws Exception {
String encoding = "UTF-8";
Echo echoPort = new EchoService().getEchoPort(new SerializationFeature(encoding));
try {
echoPort.echoString("Exception1");
fail("Exception1");
} catch (Exception1_Exception e) {
Exception1 ex = e.getFaultInfo();
assertEquals("my exception1", ex.getFaultString());
assertTrue(ex.isValid());
}
// Check if responses are encoded using UTF-8
testCharset(echoPort, encoding);
}
use of com.sun.xml.ws.developer.SerializationFeature in project metro-jax-ws by eclipse-ee4j.
the class EchoTest method testExceptionUtf16.
public void testExceptionUtf16() throws Exception {
String encoding = "UTF-16";
Echo echoPort = new EchoService().getEchoPort(new SerializationFeature(encoding));
try {
echoPort.echoString("Fault1");
fail("Fault1");
} catch (Fault1 e) {
FooException ex = e.getFaultInfo();
assertEquals("fault1", e.getMessage());
assertEquals(44F, ex.getVarFloat());
assertEquals((int) 33, (int) ex.getVarInt());
assertEquals("foo", ex.getVarString());
}
// Server sends responses encoded with UTF-16
testCharset(echoPort, "utf-16");
}
use of com.sun.xml.ws.developer.SerializationFeature in project metro-jax-ws by eclipse-ee4j.
the class EchoTest method testExceptionJIS.
public void testExceptionJIS() throws Exception {
String encoding = "Shift_JIS";
Echo echoPort = new EchoService().getEchoPort(new SerializationFeature(encoding));
try {
echoPort.echoString("WSDLBarException");
fail("WSDLBarException");
} catch (WSDLBarException e) {
Bar ex = e.getFaultInfo();
assertEquals("my barException", e.getMessage());
assertEquals(33, ex.getAge());
}
// Server sends responses encoded with UTF-16
testCharset(echoPort, "utf-16");
}
Aggregations