use of com.sun.xml.ws.developer.SerializationFeature in project metro-jax-ws by eclipse-ee4j.
the class EchoTest method testSerializationFeatureUtf16.
public void testSerializationFeatureUtf16() throws Exception {
String encoding = "UTF-16";
Echo echoPort = new EchoService().getEchoPort(new SerializationFeature(encoding));
echoPort.echoString(encoding);
// 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 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());
}
// 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 ClientFeatureTest method validateFeatureList.
private void validateFeatureList(Object bindingProvider, String expectedEncoding) throws Exception {
Binding binding = ((BindingProvider) bindingProvider).getBinding();
WSFeatureList list = (((WSBinding) binding).getFeatures());
// System.out.println(list);
SerializationFeature encoding = list.get(SerializationFeature.class);
if (expectedEncoding == null) {
assertNull("There should not be a SerializationFeature", encoding);
} else {
assertEquals("Mismatched encoding in SerializationFeature", expectedEncoding, encoding.getEncoding());
}
}
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());
}
// Check if responses are encoded using Shift_JIS
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());
}
// Check if responses are encoded using UTF-16
testCharset(echoPort, encoding);
}
Aggregations