Examples of DataBinding


Examples of org.apache.cxf.databinding.DataBinding

       
        SoapBodyInfo sbi = bmi.getExtensor(SoapBodyInfo.class);
       
        if (sbi == null || sbi.getAttachments() == null || sbi.getAttachments().size() == 0) {
            Service s = ex.getService();
            DataBinding db = s.getDataBinding();
            if (db instanceof JAXBDataBinding
                && hasSwaRef((JAXBDataBinding) db)) {
                setupAttachmentOutput(message);
            }
            return;
View Full Code Here

Examples of org.apache.cxf.databinding.DataBinding

        }
        return classes;
    }

    private Set<Class<?>> generatedWrapperBeanClass() {
        DataBinding b = getDataBinding();
        if (b.getClass().getName().endsWith("JAXBDataBinding")
            && schemaLocations == null) {
            ServiceInfo serviceInfo = getService().getServiceInfos().get(0);
            WrapperClassGenerator wrapperGen = new WrapperClassGenerator(this,
                                                                         serviceInfo.getInterface(),
                                                                         getQualifyWrapperSchema());
View Full Code Here

Examples of org.apache.cxf.databinding.DataBinding

        //Initialize Features.
        configureObject(portName.toString() + ".jaxws-client.proxyFactory", clientFac);

        AbstractServiceFactoryBean sf = null;
        try {
            DataBinding db;
            if (context != null) {
                db = new JAXBDataBinding(context);
            } else {
                db = new SourceDataBinding(type);
            }
View Full Code Here

Examples of org.apache.cxf.databinding.DataBinding

            if (b != null && b.getExtension(HeaderManager.class) != null) {
                p = b.getExtension(HeaderManager.class).getHeaderProcessor(elem.getNamespaceURI());
            }
               
            Object obj;
            DataBinding dataBinding = null;
            if (p == null || p.getDataBinding() == null) {
                obj = elem;
            } else {
                obj = p.getDataBinding().createReader(Node.class).read(elem);
            }
View Full Code Here

Examples of org.apache.cxf.databinding.DataBinding

   
    
    protected DataBinding createDefaultDataBinding() {
       
        DataBinding retVal = null;
       
        if (getServiceClass() != null) {
            org.apache.cxf.annotations.DataBinding db
                = getServiceClass().getAnnotation(org.apache.cxf.annotations.DataBinding.class);
            if (db != null) {
View Full Code Here

Examples of org.apache.cxf.databinding.DataBinding

        c = ResourceUtils.createClassResourceInfo(TheBooks.class, TheBooks.class, true, true);
    }
   
    public void testJAXBWrite() throws Exception {
        Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
        DataBinding binding = new JAXBDataBinding();
        binding.initialize(s);
        DataBindingJSONProvider p = new DataBindingJSONProvider();
        p.setDataBinding(binding);
        Book b = new Book("CXF", 127L);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        p.writeTo(b, Book.class, Book.class,
View Full Code Here

Examples of org.apache.cxf.databinding.DataBinding

    @SuppressWarnings("unchecked")
    @Test
    public void testJAXBRead() throws Exception {
        String data = "{\"Book\":{\"id\":127,\"name\":\"CXF\",\"state\":\"\"}}";
        Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
        DataBinding binding = new JAXBDataBinding();
        binding.initialize(s);
        DataBindingJSONProvider p = new DataBindingJSONProvider();
        p.setDataBinding(binding);
        ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
        Book book = (Book)p.readFrom((Class)Book.class, Book.class,
                                      new Annotation[0], MediaType.APPLICATION_JSON_TYPE,
View Full Code Here

Examples of org.apache.cxf.databinding.DataBinding

        ep = getEndpointImplBean("publishedEndpointUrl", ctx);
        String expectedEndpointUrl = "http://cxf.apache.org/Greeter";
        assertEquals(expectedEndpointUrl, ep.getPublishedEndpointUrl());
       
        ep = getEndpointImplBean("epWithDataBinding", ctx);
        DataBinding dataBinding = ep.getDataBinding();
       
        assertTrue(dataBinding instanceof JAXBDataBinding);
        assertEquals("The namespace map should have an entry",
                     ((JAXBDataBinding)dataBinding).getNamespaceMap().size(), 1);
        // test for existence of Endpoint without an id element
View Full Code Here

Examples of org.apache.cxf.databinding.DataBinding

                    XMLStreamWriter writer = xtw;
                    if (header instanceof SoapHeader) {
                        SoapHeader soapHeader = (SoapHeader)header;
                        writer = new SOAPHeaderWriter(xtw, soapHeader, soapVersion, soapPrefix);
                    }
                    DataBinding b = header.getDataBinding();
                    if (b == null) {
                        HeaderProcessor hp = bus.getExtension(HeaderManager.class)
                                .getHeaderProcessor(header.getName().getNamespaceURI());
                        if (hp != null) {
                            b = hp.getDataBinding();
                        }
                    }
                    if (b != null) {
                        MessagePartInfo part = new MessagePartInfo(header.getName(), null);
                        part.setConcreteName(header.getName());
                        b.createWriter(XMLStreamWriter.class)
                            .write(header.getObject(), part, writer);
                    } else {
                        Element node = (Element)header.getObject();
                        StaxUtils.copy(node, writer);
                    }
View Full Code Here

Examples of org.apache.cxf.tools.plugin.DataBinding

                 
        Map<String, DataBinding> databindings = loader.getDataBindings();
        assertNotNull(databindings);
        assertEquals(2, databindings.size());
       
        DataBinding databinding = getDataBinding(databindings, 0);
        assertEquals("jaxb", databinding.getName());
        assertEquals("org.apache.cxf.tools.wsdlto.databinding.jaxb", databinding.getPackage());
        assertEquals("JAXBDataBinding", databinding.getProfile());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.