Examples of JAXBWrapperToolImpl


Examples of org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl

                if (isNoReturn) {
                    returnValue = null;
                } else if (isChildReturn) {
                    String returnName = operationDesc.getResultPartName();
                    // Use the wrapper tool to get the child objects.
                    JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();
                    Object object = wrapperTool.unWrap(wrapperObject,
                            returnName,
                            marshalDesc.getPropertyDescriptorMap(
                                    wrapperObject.getClass()).get(returnName));
                    returnValue = object;
                    // returnValue may be incompatible with JAX-WS signature
                    if (ConvertUtils.isConvertable(returnValue, returnType)) {
                        returnValue = ConvertUtils.convert(returnValue, returnType);
                    } else {
                        String objectClass =
                                (returnValue == null) ? "null" : returnValue.getClass().getName();
                        throw ExceptionFactory.makeWebServiceException(
                                Messages.getMessage("convertProblem", objectClass,
                                                    returnType.getName()));
                    }
                   
                } else {
                    returnValue = wrapperObject;
                }
            } else {
                // There are one or more OUT or INOUT parameters
                // The return name is added as the last name
                if (isChildReturn && !isNoReturn) {
                    names.add(operationDesc.getResultPartName());
                }

                // Use the wrapper tool to get the child objects.
                JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();
               
                // Get the child objects
                Object[] objects = wrapperTool.unWrap(wrapperObject, names,
                        marshalDesc.getPropertyDescriptorMap(
                                wrapperObject.getClass()));

                // Now create a list of paramValues so that we can populate the signature
                List<PDElement> pvList = new ArrayList<PDElement>();
View Full Code Here

Examples of org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl

            if (wrapperObject instanceof JAXBElement) {
                wrapperObject = ((JAXBElement)wrapperObject).getValue();
            }

            // Use the wrapper tool to get the child objects.
            JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();

            // Get the list of names for the input parameters
            List<String> names = new ArrayList<String>();
            List<ParameterDescription> pdList = new ArrayList<ParameterDescription>();
            for (int i = 0; i < pds.length; i++) {
                ParameterDescription pd = pds[i];
                if (pd.getMode() == Mode.IN ||
                        pd.getMode() == Mode.INOUT) {
                    names.add(pd.getParameterName());
                    pdList.add(pd);
                }

            }

            // Get the child objects
            Object[] objects = wrapperTool.unWrap(wrapperObject, names,
                                                  marshalDesc.getPropertyDescriptorMap(
                                                          wrapperObject.getClass()));

            // Now create a list of paramValues
            List<PDElement> pvList = new ArrayList<PDElement>();
View Full Code Here

Examples of org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl

                                                        false,  // output
                                                        true, false);
           
            String wrapperName = marshalDesc.getResponseWrapperClassName(operationDesc);
            Class cls = loadClass(wrapperName, endpointDesc);
            JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();
            Object object = null;
           
            // Add the return object to the nameList and objectList
            Class returnType = operationDesc.getResultActualType();
           
            // Now we want to create a single JAXB element that contains the
            // ParameterValues.  We will use the wrapper tool to do this.
            // Create the inputs to the wrapper tool
            if (pdeList.size() == 0) {
                if (returnType == void.class) {
                    // Use the short-cut for void return
                    object = wrapperTool.wrap(cls,
                            (String) null,
                            null,
                            null,
                            null);
                } else {
                    // Use the short-cut for a single return
                    String childName = operationDesc.getResultName();
                    object = wrapperTool.wrap(cls,
                            childName,
                            returnObject,
                            returnType,
                            marshalDesc.getPropertyDescriptorMap(cls).get(childName));
                }
            } else {          

                // Now we want to create a single JAXB element that contains the
                // ParameterValues.  We will use the wrapper tool to do this.
                // Create the inputs to the wrapper tool
                ArrayList<String> nameList = new ArrayList<String>();
                Map<String, Object> objectList = new HashMap<String, Object>();
                Map<String, Class>  declaredClassMap = new HashMap<String, Class>();

                for (PDElement pde : pdeList) {
                    String name = pde.getParam().getParameterName();

                    // The object list contains type rendered objects
                    Object value = pde.getElement().getTypeValue();
                    Class dclClass = pde.getParam().getParameterActualType();

                    nameList.add(name);
                    objectList.put(name, value);
                    declaredClassMap.put(name, dclClass);
                }

                // Add the return type
                if (returnType != void.class) {
                    String name = operationDesc.getResultName();
                    nameList.add(name);
                    objectList.put(name, returnObject);
                    declaredClassMap.put(name, returnType);
                }

               
                object = wrapperTool.wrap(cls, nameList, objectList, declaredClassMap,
                        marshalDesc.getPropertyDescriptorMap(cls));
            }

            QName wrapperQName = new QName(operationDesc.getResponseWrapperTargetNamespace(),
                                           operationDesc.getResponseWrapperLocalName());
View Full Code Here

Examples of org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl

                                                                         true,   // input
                                                                         true, false);

            String wrapperName = marshalDesc.getRequestWrapperClassName(operationDesc);
            Class cls = loadClass(wrapperName, endpointDesc);
            JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();
            Object object = null;
           
            // Now we want to create a single JAXB element that contains the
            // ParameterValues.  We will use the wrapper tool to do this.
            // Create the inputs to the wrapper tool
            if (pvList.size() ==  0) {
                // Use the short-cut for 0 children
                object = wrapperTool.wrap(cls,
                        (String) null,
                        null,
                        null,
                        null);
            } else if (pvList.size() == 1) {
                // Use the short-cut for 1 child
                PDElement pde = pvList.get(0);
                String childName = pde.getParam().getParameterName();
                object = wrapperTool.wrap(cls,
                        childName,
                        pde.getElement().getTypeValue(),
                        pde.getParam().getParameterActualType(),
                        marshalDesc.getPropertyDescriptorMap(cls).get(childName));

            } else {          
                ArrayList<String> nameList = new ArrayList<String>();
                Map<String, Object> objectList = new HashMap<String, Object>();
                Map<String, Class> declaredClassMap = new HashMap<String, Class>();

                for (PDElement pv : pvList) {
                    String name = pv.getParam().getParameterName();

                    // The object list contains type rendered objects
                    Object value = pv.getElement().getTypeValue();
                    Class dclClass = pv.getParam().getParameterActualType();
                    nameList.add(name);
                    objectList.put(name, value);
                    declaredClassMap.put(name, dclClass);
                }

               
                object = wrapperTool.wrap(cls, nameList, objectList, declaredClassMap,
                        marshalDesc.getPropertyDescriptorMap(cls));
            }

            QName wrapperQName = new QName(operationDesc.getRequestWrapperTargetNamespace(),
                                           operationDesc.getRequestWrapperLocalName());
View Full Code Here

Examples of org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl

                if (log.isErrorEnabled()) {
                    log.debug("List of properties on the Legacy Exception is " + childNames);
                }
                // Use the wrapper tool to get the child objects.
                JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();
                Map<String, PropertyDescriptorPlus> pdMapForBean =
                        marshalDesc.getPropertyDescriptorMap(faultBeanClass);
                faultBean =
                        wrapperTool.wrap(faultBeanClass, childNames, childObjects, declaringClass, pdMapForBean);
                if (log.isErrorEnabled()) {
                    log.debug("Completed creation of the fault bean.");
                }
            } else {
                throw ExceptionFactory.makeWebServiceException(
View Full Code Here

Examples of org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl

            if (log.isErrorEnabled()) {
                log.debug("The constructor used to create the exception is " + constructor);
            }
            // Use the wrapper tool to unwrap the jaxb object
            JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();
            Map<String, PropertyDescriptorPlus> pdMapForBean =
                    marshalDesc.getPropertyDescriptorMap(jaxb.getClass());
            Object[] childObjects = wrapperTool.unWrap(jaxb, childNames, pdMapForBean);

            if (log.isErrorEnabled()) {
                log.debug("Calling newInstance on the constructor " + constructor);
            }
            e = (Exception)constructor.newInstance(childObjects);
View Full Code Here

Examples of org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl

            if (wrapperObject instanceof JAXBElement) {
                wrapperObject = ((JAXBElement)wrapperObject).getValue();
            }

            // Use the wrapper tool to get the child objects.
            JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();

            // Get the list of names for the output parameters
            List<String> names = new ArrayList<String>();
            List<ParameterDescription> pdList = new ArrayList<ParameterDescription>();
            for (int i = 0; i < pds.length; i++) {
                ParameterDescription pd = pds[i];
                if (pd.getMode() == Mode.OUT ||
                        pd.getMode() == Mode.INOUT) {
                    if (!pd.isHeader()) {
                        // Header names are not in the wrapped element
                        names.add(pd.getParameterName());
                    }
                    pdList.add(pd);
                }
            }


            if (!operationDesc.isResultHeader()) {
                // Normal case (Body Result) The return name is in the wrapped object
                if (isChildReturn && !isNoReturn) {
                    names.add(operationDesc.getResultPartName());
                }
            }

            // Get the child objects
            Object[] objects = wrapperTool.unWrap(wrapperObject, names,
                                                  marshalDesc.getPropertyDescriptorMap(
                                                          wrapperObject.getClass()));

            // Now create a list of paramValues so that we can populate the signature
            List<PDElement> pvList = new ArrayList<PDElement>();
View Full Code Here

Examples of org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl

            if (wrapperObject instanceof JAXBElement) {
                wrapperObject = ((JAXBElement)wrapperObject).getValue();
            }

            // Use the wrapper tool to get the child objects.
            JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();

            // Get the list of names for the input parameters
            List<String> xmlNames = new ArrayList<String>();
            List<ParameterDescription> pdList = new ArrayList<ParameterDescription>();
            for (int i = 0; i < pds.length; i++) {
                ParameterDescription pd = pds[i];
                if (pd.getMode() == Mode.IN ||
                        pd.getMode() == Mode.INOUT) {
                    if (!pd.isHeader()) {
                        // Only the body parameters will be present in the wrapper object
                        xmlNames.add(pd.getParameterName());
                    }
                    pdList.add(pd);
                }

            }

            // Get the child objects
            Object[] objects = wrapperTool.unWrap(wrapperObject, xmlNames,
                                                  marshalDesc.getPropertyDescriptorMap(
                                                          wrapperObject.getClass()));

            // Now create a list of paramValues
            List<PDElement> pvList = new ArrayList<PDElement>();
View Full Code Here

Examples of org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl

            // Now create the single JAXB element
            String wrapperName = marshalDesc.getResponseWrapperClassName(operationDesc);
            Class cls = loadClass(wrapperName, endpointDesc);
           
            JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();
            Object object = wrapperTool.wrap(cls, nameList, objectList, declaredClassMap,
                                             marshalDesc.getPropertyDescriptorMap(cls));

            QName wrapperQName = new QName(operationDesc.getResponseWrapperTargetNamespace(),
                                           operationDesc.getResponseWrapperLocalName());
View Full Code Here

Examples of org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl

            // Now create the single JAXB element
            String wrapperName = marshalDesc.getRequestWrapperClassName(operationDesc);
            Class cls = loadClass(wrapperName, endpointDesc);
           
            JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();
            Object object = wrapperTool.wrap(cls, nameList, objectList, declardClassMap,
                                             marshalDesc.getPropertyDescriptorMap(cls));

            QName wrapperQName = new QName(operationDesc.getRequestWrapperTargetNamespace(),
                                           operationDesc.getRequestWrapperLocalName());
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.