Package org.apache.cxf.jaxws.interceptors

Examples of org.apache.cxf.jaxws.interceptors.WrapperHelper


        List<Class<?>> partClasses = Arrays.asList(new Class<?>[] {List.class});
          
        String className = requestClass.getName();
        className = className.substring(0, className.lastIndexOf(".") + 1);
       
        WrapperHelper wh = WrapperHelper.createWrapperHelper(requestClass,
                                                             partNames, elTypeNames, partClasses);       
       
        List<Object> paraList = new ArrayList<Object>();
        List<String> valueList = new ArrayList<String>();
        valueList.add("str1");
        valueList.add("str2");
        valueList.add("str3");
        paraList.add(valueList);
        Object requestObj = wh.createWrapperObject(paraList);
        // Create response wrapper Object
       
        partNames = Arrays.asList(new String[] {"return"});
        elTypeNames = Arrays.asList(new String[] {"list"});
        partClasses = Arrays.asList(new Class<?>[] {List.class});
          
        className = responseClass.getName();
        className = className.substring(0, className.lastIndexOf(".") + 1);
       
        wh = WrapperHelper.createWrapperHelper(responseClass,
                                                             partNames, elTypeNames, partClasses);       
        List<Object> resPara = new ArrayList<Object>();
        List<Integer> intValueList = new ArrayList<Integer>();
        intValueList.add(1);
        intValueList.add(2);
        intValueList.add(3);
        resPara.add(intValueList);
        Object responseObj = wh.createWrapperObject(resPara);
             
        JAXBContext jaxbContext = JAXBContext.newInstance(requestClass, responseClass);
        java.io.ByteArrayOutputStream bout = new java.io.ByteArrayOutputStream();
        Marshaller marshaller = jaxbContext.createMarshaller();
       
View Full Code Here


            boolean[].class,
            String.class,
            List.class,
        });
       
        WrapperHelper wh = WrapperHelper.createWrapperHelper(SetIsOK.class,
                                          partNames,
                                          elTypeNames,
                                          partClasses);
       
        List<Object> lst = wh.getWrapperParts(ok);
        assertEquals(5, lst.size());
        assertTrue(lst.get(0) instanceof Boolean);
        assertTrue(lst.get(1) instanceof Integer);
        assertTrue(lst.get(2) instanceof boolean[]);
        assertTrue(((boolean[])lst.get(2))[0]);
        assertFalse(((boolean[])lst.get(2))[1]);
        assertEquals("hello", (String)lst.get(3));

        lst.set(0, Boolean.TRUE);
        Object o = wh.createWrapperObject(lst);
        assertNotNull(0);
        ok = (SetIsOK)o;
        assertTrue(ok.isParameter1());
        assertTrue(ok.getParameter3()[0]);
        assertFalse(ok.getParameter3()[1]);
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxws.interceptors.WrapperHelper

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.