FileDocCategorySizeDatePackage
TestArrays2TestCase.javaAPI DocApache Axis 1.47836Sat Apr 22 18:57:28 BST 2006test.wsdl.arrays2

TestArrays2TestCase

public class TestArrays2TestCase extends TestCase

Fields Summary
private static org.apache.axis.server.AxisServer
server
private static String
xml
Constructors Summary
public TestArrays2TestCase(String name)

        super(name);
    
Methods Summary
public voidtestBug22213()


         
        TypeMappingRegistry tmr = server.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) tmr.createTypeMapping();
        tm.setSupportedEncodings(new String[]{Constants.URI_DEFAULT_SOAP_ENC});
        tmr.register(Constants.URI_DEFAULT_SOAP_ENC, tm);
        tm.register(test.wsdl.arrays2.data.DataType.class,
                new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/data/1.0", "dataType"),
                new org.apache.axis.encoding.ser.BeanSerializerFactory(
                        test.wsdl.arrays2.data.DataType.class,
                        new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/data/1.0", "dataType")),
                new org.apache.axis.encoding.ser.BeanDeserializerFactory(
                        test.wsdl.arrays2.data.DataType.class,
                        new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/data/1.0", "dataType")));
        tm.register(InnerDataType.class,
                new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "innerDataType"),
                new org.apache.axis.encoding.ser.BeanSerializerFactory(
                        InnerDataType.class,
                        new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "innerDataType")),
                new org.apache.axis.encoding.ser.BeanDeserializerFactory(
                        InnerDataType.class,
                        new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "innerDataType")));
        tm.register(String.class,
                new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "trDescrType"),
                new org.apache.axis.encoding.ser.SimpleSerializerFactory(
                        String.class,
                        new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "trDescrType")),
                new org.apache.axis.encoding.ser.SimpleDeserializerFactory(
                        String.class,
                        new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "trDescrType")));

        tm.register(DataRequestType.class,
                new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "dataRequestType"),
                new org.apache.axis.encoding.ser.BeanSerializerFactory(
                        DataRequestType.class,
                        new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "dataRequestType")),
                new org.apache.axis.encoding.ser.BeanDeserializerFactory(
                        DataRequestType.class,
                        new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "dataRequestType")));

        tm.register(InnerDataType[].class,
                new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "innerDataArrType"),
                new org.apache.axis.encoding.ser.ArraySerializerFactory(),
                new org.apache.axis.encoding.ser.ArrayDeserializerFactory());

        Message message = new Message(xml);
        message.setMessageContext(new MessageContext(server));

        SOAPEnvelope envelope = (SOAPEnvelope) message.getSOAPEnvelope();
        RPCElement body = (RPCElement) envelope.getFirstBody();
        Vector arglist = body.getParams();
        RPCParam param = (RPCParam) arglist.get(0);
        DataType result = (DataType) param.getObjectValue();
        System.out.println(result);
        assertTrue(result != null);
        InnerDataType inner[] = result.getInnerData();
        assertTrue(inner != null);
        assertEquals(inner.length, 10);
        assertEquals(inner[9].getTrDescr().trim(),"desc#9 HELLO!");