Search in sources :

Example 11 with SerializationFeature

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);
}
Also used : SerializationFeature(com.sun.xml.ws.developer.SerializationFeature)

Example 12 with SerializationFeature

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");
}
Also used : SerializationFeature(com.sun.xml.ws.developer.SerializationFeature)

Example 13 with SerializationFeature

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");
}
Also used : SerializationFeature(com.sun.xml.ws.developer.SerializationFeature)

Aggregations

SerializationFeature (com.sun.xml.ws.developer.SerializationFeature)13 WSBinding (com.sun.xml.ws.api.WSBinding)1 WSFeatureList (com.sun.xml.ws.api.WSFeatureList)1 Binding (jakarta.xml.ws.Binding)1 BindingProvider (jakarta.xml.ws.BindingProvider)1 HTTPBinding (jakarta.xml.ws.http.HTTPBinding)1