Package org.apache.axis.utils

Examples of org.apache.axis.utils.QName


    }
     */

    public void testToString()
    {
        QName qname = new QName("PREFIX", "LOCALPART");
        assertEquals("PREFIX:LOCALPART", qname.toString());

        qname.setNamespaceURI(null);
        assertEquals("LOCALPART", qname.toString());
    }
View Full Code Here


        assertEquals("LOCALPART", qname.toString());
    }

    public void testEquals()
    {
        QName qname1 = new QName();
        QName qname2 = new QName("PREFIX", "LOCALPART");
        QName qname3 = new QName("PREFIX", "LOCALPART");
        QName qname4 = new QName("PREFIX", "DIFFLOCALPART");
        //need a fully implemented mock Element class...
        //Element elem = new MockElement();       
        ////QName qname5 = new QName("PREFIX:LOCALPART", elem);

        // the following should NOT throw a NullPointerException
View Full Code Here

        assertTrue(!qname3.equals(qname4));
    }
   
    public void testHashCode()
    {
        QName control = new QName("xsl", "text");
        QName compare = new QName("xsl", "text");
        QName contrast = new QName("xso", "text");
        assertEquals(control.hashCode(), compare.hashCode());
        assertTrue(!(control.hashCode() == contrast.hashCode()));
    }
View Full Code Here

     * Test a method that reverses a data structure
     */
    public void testReverseDataWithUntypedParam() throws Exception {
        BeanSerializer ser = new BeanSerializer(Data.class);
        DeserializerFactory dSerFactory = BeanSerializer.getFactory();
        QName qName = new QName("urn:foo", "Data");
        engine.registerTypeMapping(qName, Data.class, dSerFactory,
                                   ser);
       
        // invoke the service and verify the result
        String arg = "<arg0 xmlns:foo=\"urn:foo\">";
View Full Code Here

     * Test DOM round tripping
     */
    public void testArgAsDOM() throws Exception {
        BeanSerializer ser = new BeanSerializer(Data.class);
        DeserializerFactory dSerFactory = BeanSerializer.getFactory();
        QName qName = new QName("urn:foo", "Data");
        engine.registerTypeMapping(qName, Data.class, dSerFactory,
                                   ser);
       
        // invoke the service and verify the result
        String arg = "<arg0 xmlns:foo=\"urn:foo\">";
View Full Code Here

     * Test a method that reverses a data structure
     */
    public void testSerReverseData() throws Exception {
        BeanSerializer ser = new BeanSerializer(Data.class);
        DeserializerFactory dSerFactory = BeanSerializer.getFactory();
        QName qName = new QName("urn:foo", "Data");
        engine.registerTypeMapping(qName, Data.class, dSerFactory,
                                   ser);
       
        // invoke the service and verify the result
        String arg = "<arg0 xmlns:foo=\"urn:foo\" xsi:type=\"foo:Data\">";
View Full Code Here

    /**
     * Execute the tests
     */
    public void execute() throws Exception {
        // register the SOAPStruct class
        QName ssqn = new QName("http://soapinterop.org/xsd", "SOAPStruct");
        Class cls = SOAPStruct.class;
        call.addSerializer(cls, ssqn, new BeanSerializer(cls));
        call.addDeserializerFactory(ssqn, cls, BeanSerializer.getFactory());

        // execute the tests
View Full Code Here

                                    String prefix,
                                    Attributes attributes,
                                    DeserializationContext context)
        throws SAXException
    {
        QName typeQName = (QName)typesByMemberName.get(localName);
        if (typeQName == null)
            throw new SAXException("Invalid element in Data struct - " + localName);
       
        // These can come in either order.
        Deserializer dSer = context.getTypeMappingRegistry().
View Full Code Here

        if (!(value instanceof Data))
            throw new IOException("Can't serialize a " + value.getClass().getName() + " with a DataSerializer.");
        Data data = (Data)value;
       
        context.startElement(name, attributes);
        context.serialize(new QName("", STRINGMEMBER), null, data.stringMember);
        context.serialize(new QName("", FLOATMEMBER), null, data.floatMember);
        context.serialize(new QName("", DATAMEMBER), null, data.dataMember);
        context.endElement();
    }
View Full Code Here

        Options opts = new Options(args);
        call = new ServiceClient(opts.getURL());
        call.set(HTTPTransport.ACTION, "http://www.soapinterop.org/Bid");

        // register the PurchaseOrder class
        QName poqn = new QName("http://www.soapinterop.org/Bid",
                               "PurchaseOrder");
        Class cls = PurchaseOrder.class;
        call.addSerializer(cls, poqn, new BeanSerializer(cls));
        call.addDeserializerFactory(poqn, cls, BeanSerializer.getFactory());

        // register the Address class
        QName aqn = new QName("http://www.soapinterop.org/Bid", "Address");
        cls = Address.class;
        call.addSerializer(cls, aqn, new BeanSerializer(cls));
        call.addDeserializerFactory(aqn, cls, BeanSerializer.getFactory());

        // register the LineItem class
        QName liqn = new QName("http://www.soapinterop.org/Bid", "LineItem");
        cls = LineItem.class;
        call.addSerializer(cls, liqn, new BeanSerializer(cls));
        call.addDeserializerFactory(liqn, cls, BeanSerializer.getFactory());

        try {
View Full Code Here

TOP

Related Classes of org.apache.axis.utils.QName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.