Package org.apache.cxf.jaxb

Examples of org.apache.cxf.jaxb.JAXBDataBinding$CachedClassOrNull


        }
    }

    private JAXBDataBinding getTestWriterFactory(Class<?>... clz) throws Exception {
        JAXBContext ctx = JAXBContext.newInstance(clz);
        return new JAXBDataBinding(ctx);
    }
View Full Code Here


                service.getPort(portQName, DoubleItPortType2.class);
        updateAddressPort(x509Port, PORT);
       
        List<Header> headers = new ArrayList<Header>();
        Header dummyHeader = new Header(new QName("uri:org.apache.cxf", "dummy"), "dummy-header",
                                        new JAXBDataBinding(String.class));
        headers.add(dummyHeader);
        ((BindingProvider)x509Port).getRequestContext().put(Header.HEADER_LIST, headers);
       
        int response = x509Port.doubleIt(25);
        assertEquals(50, response);
View Full Code Here

        } catch (JAXBException jbe) {
            throw new IllegalStateException("Unable to create JAXBContext for generated packages: "
                                            + jbe.getMessage(), jbe);
        }
        
        JAXBDataBinding databinding = new JAXBDataBinding();
        databinding.setContext(context);
        svc.setDataBinding(databinding);

        ServiceInfo svcfo = client.getEndpoint().getEndpointInfo().getService();

        // Setup the new classloader!
View Full Code Here

        is.close();
    }

    @Test
    public void testSetProperty() throws Exception {
        JAXBDataBinding db = getDataBinding(GreetMe.class);
   
        reader = getTestReader("../resources/SetPropertyValidationFailureReq.xml");
        assertNotNull(reader);
       
        DataReaderImpl<XMLStreamReader> dr = (DataReaderImpl<XMLStreamReader>)db.createReader(XMLStreamReader.class);
        assertNotNull(dr);
       
        // Build message to set custom event handler
        org.apache.cxf.message.Message message = new org.apache.cxf.message.MessageImpl();
        message.put("jaxb-validation-event-handler", new MyCustomHandler());
View Full Code Here

        assertTrue(((MyCustomHandler)dr.veventHandler).getUsed());
    }
   
    @Test
    public void testReadWrapper() throws Exception {
        JAXBDataBinding db = getDataBinding(GreetMe.class);
       
        reader = getTestReader("../resources/GreetMeDocLiteralReq.xml");
        assertNotNull(reader);
       
        DataReader<XMLStreamReader> dr = db.createReader(XMLStreamReader.class);
        assertNotNull(dr);
        Object val = dr.read(reader);
        assertNotNull(val);
        assertTrue(val instanceof GreetMe);
        assertEquals("TestSOAPInputPMessage", ((GreetMe)val).getRequestType());
View Full Code Here

        assertEquals("TestSOAPInputPMessage", ((GreetMe)val).getRequestType());
    }

    @Test
    public void testReadWrapperReturn() throws Exception {
        JAXBDataBinding db = getDataBinding(GreetMeResponse.class);

        reader = getTestReader("../resources/GreetMeDocLiteralResp.xml");
        assertNotNull(reader);

        DataReader<XMLStreamReader> dr = db.createReader(XMLStreamReader.class);
        assertNotNull(dr);
       
        Object retValue = dr.read(reader);
       
        assertNotNull(retValue);
View Full Code Here

        assertEquals("TestSOAPOutputPMessage", ((GreetMeResponse)retValue).getResponseType());
    }

    @Test
    public void testReadRPC() throws Exception {
        JAXBDataBinding db = getDataBinding(MyComplexStruct.class);

        QName[] tags = {new QName("http://apache.org/hello_world_rpclit", "sendReceiveData")};

        reader = getTestReader("../resources/greetMeRpcLitReq.xml");
        assertNotNull(reader);
       
        XMLStreamReader localReader = getTestFilteredReader(reader, tags);

        DataReader<XMLStreamReader> dr = db.createReader(XMLStreamReader.class);
        assertNotNull(dr);
        Object val = dr.read(new QName("http://apache.org/hello_world_rpclit", "in"),
                             localReader,
                             MyComplexStruct.class);
        assertNotNull(val);
View Full Code Here

    }


    @Test
    public void testReadBare() throws Exception {
        JAXBDataBinding db = getDataBinding(TradePriceData.class);

        reader = getTestReader("../resources/sayHiDocLitBareReq.xml");
        assertNotNull(reader);
       
        DataReader<XMLStreamReader> dr = db.createReader(XMLStreamReader.class);
        assertNotNull(dr);
        QName elName = new QName("http://apache.org/hello_world_doc_lit_bare/types", "inout");
        MessagePartInfo part = new MessagePartInfo(elName, null);
        part.setElement(true);
        part.setElementQName(elName);
View Full Code Here

        assertEquals(new Float(1.0f), new Float(((TradePriceData)val).getTickerPrice()));
    }

    private JAXBDataBinding getDataBinding(Class<?>... clz) throws Exception {
        JAXBContext ctx = JAXBContext.newInstance(clz);
        return new JAXBDataBinding(ctx);
    }
View Full Code Here

    }

   
    
    protected DataBinding createDefaultDataBinding() {
        return new JAXBDataBinding(getQualifyWrapperSchema());
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxb.JAXBDataBinding$CachedClassOrNull

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.