FileDocCategorySizeDatePackage
TestGlobalTypeMappings.javaAPI DocApache Axis 1.42733Sat Apr 22 18:57:28 BST 2006test.encoding

TestGlobalTypeMappings

public class TestGlobalTypeMappings extends test.GenericLocalTest
Confirm that global type mappings work in both RPC and Document contexts.
author
Glen Daniels (gdaniels@apache.org)

Fields Summary
private QName
TYPE_QNAME
Constructors Summary
public TestGlobalTypeMappings()


      
        super("service");
    
public TestGlobalTypeMappings(String s)

        super(s);
    
Methods Summary
public DataechoData(Data data)
Our service method. We'll deploy this several ways.

param
data
return

        return data;
    
protected voidsetUp()

        super.setUp(false); // don't deploy here
        TypeMapping tm = (TypeMapping)config.getTypeMappingRegistry().
                getDefaultTypeMapping();
        tm.register(Data.class, TYPE_QNAME,
                    new BeanSerializerFactory(Data.class, TYPE_QNAME),
                    new BeanDeserializerFactory(Data.class, TYPE_QNAME));
    
public voidtestDocLit()

        deploy("service", this.getClass(), Style.WRAPPED);
        Call call = getCall();
        call.setOperationStyle("wrapped");
        call.setOperationUse("literal");
        call.setEncodingStyle("");
        call.registerTypeMapping(Data.class, TYPE_QNAME,
                    new BeanSerializerFactory(Data.class, TYPE_QNAME),
                    new BeanDeserializerFactory(Data.class, TYPE_QNAME));
        call.setReturnClass(Data.class);
        call.addParameter("arg0", TYPE_QNAME, ParameterMode.IN);
        Data data = new Data();
        data.stringMember = "doc lit test";
        data.floatMember = new Float(451.0F);
        call.invoke("echoData", new Object [] { data });