FileDocCategorySizeDatePackage
TestJWSGlobalTypes.javaAPI DocApache Axis 1.42580Sat Apr 22 18:57:26 BST 2006test.functional

TestJWSGlobalTypes

public class TestJWSGlobalTypes extends TestCase
author
Glen Daniels (gdaniels@apache.org)

Fields Summary
private static final String
TYPEMAPPING_WSDD
Constructors Summary
public TestJWSGlobalTypes(String s)


       
        super(s);
    
Methods Summary
protected voidsetUp()

        // Deploy the type mapping
        AdminClient client = new AdminClient();
        Options opts = new Options(null);
        ByteArrayInputStream bis =
                new ByteArrayInputStream(TYPEMAPPING_WSDD.getBytes());
        client.process(opts, bis);
    
public voidtestGlobalTypes()

        Call call = new Call("http://localhost:8080/jws/GlobalTypeTest.jws");
        QName qname = new QName("http://globalTypeTest", "GlobalType");
        call.registerTypeMapping(GlobalBean.class, qname,
                    new BeanSerializerFactory(GlobalBean.class, qname),
                    new BeanDeserializerFactory(GlobalBean.class, qname));
        GlobalBean bean = new GlobalBean();
        bean.setIntValue(4);
        GlobalBean ret = (GlobalBean)call.invoke("echo", new Object [] { bean });
        assertEquals(4, ret.getIntValue());