Package org.apache.cxf.xmlbeans

Examples of org.apache.cxf.xmlbeans.XmlBeansDataBinding.initialize()


    @SuppressWarnings("unchecked")
    @Test
    public void testXmlBeansWrite() throws Exception {
        Service s = new JAXRSServiceImpl(Collections.singletonList(c3), true);
        DataBinding binding = new XmlBeansDataBinding();
        binding.initialize(s);
        DataBindingProvider p = new DataBindingProvider(binding);
        Address address = Address.Factory.newInstance();
        address.setAddressLine1("Street 1");
       
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
View Full Code Here


    public void testXmlBeansRead() throws Exception {
        String data = "<tns:Address xmlns:tns=\"http://cxf.apache.org/jaxrs/providers/xmlbeans/types\">"
            + "<addressLine1>Street 1</addressLine1></tns:Address>";
        Service s = new JAXRSServiceImpl(Collections.singletonList(c3), true);
        DataBinding binding = new XmlBeansDataBinding();
        binding.initialize(s);
        DataBindingProvider p = new DataBindingProvider(binding);
        ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
        Address address = (Address)p.readFrom((Class)Address.class, Address.class,
                                      new Annotation[0], MediaType.APPLICATION_XML_TYPE,
                                      new MetadataMap<String, String>(), is);
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.