Examples of WrapperInfo


Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

                                    Map<QName, List<ElementInfo>> wrappers,
                                    boolean input) throws WSDLException {
        Part part = definition.createPart();
        String partName = input ? operation.getName() : (operation.getName() + "Response");
        part.setName(partName);
        WrapperInfo opWrapper = operation.getWrapper();
        if (opWrapper != null) {
            ElementInfo elementInfo =
                input ? opWrapper.getInputWrapperElement() : opWrapper.getOutputWrapperElement();
            List<ElementInfo> elements =
                input ? opWrapper.getInputChildElements() : opWrapper.getOutputChildElements();
            QName wrapperName = elementInfo.getQName();
            part.setElementName(wrapperName);
            addNamespace(definition, wrapperName);
            wrappers.put(wrapperName, elements);
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

                        }

                    }
                }
                if (op.isWrapperStyle()) {
                    WrapperInfo wrapper = op.getWrapper();
                    if (wrapper != null) {
                        DataType<List<DataType>> unwrappedInputType = wrapper.getUnwrappedInputType();
                        if (unwrappedInputType != null) {
                            for (DataType d : unwrappedInputType.getLogical()) {
                                if (d.getDataBinding() == null) {
                                    d.setDataBinding(dataBinding);
                                }
                            }
                        }
                        DataType unwrappedOutputType = wrapper.getUnwrappedOutputType();
                        if (unwrappedOutputType != null && unwrappedOutputType.getDataBinding() == null) {
                            unwrappedOutputType.setDataBinding(dataBinding);
                        }
                    }
                }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

                    setDataBinding(d, dataBinding);
                    setDataBinding((DataType) d.getLogical(), dataBinding);
                }
            }
            if (op.isWrapperStyle()) {
                WrapperInfo wrapper = op.getWrapper();
                if (wrapper != null) {
                    DataType<List<DataType>> unwrappedInputType = wrapper.getUnwrappedInputType();
                    if (unwrappedInputType != null) {
                        for (DataType d : unwrappedInputType.getLogical()) {
                            setDataBinding(d, dataBinding);
                        }
                    }
                    DataType<List<DataType>> unwrappedOutputType = wrapper.getUnwrappedOutputType();
                    if (unwrappedOutputType != null) {
                        for (DataType d : unwrappedOutputType.getLogical()) {
                            setDataBinding(d, dataBinding);
                        }
                    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

        String targetDataBinding = getDataBinding(targetOp);
        targetWrapperHandler = getWrapperHandler(targetDataBinding, targetWrapped);

        if ((!sourceWrapped) && targetWrapped) {
            // Unwrapped --> Wrapped
            WrapperInfo wrapper = targetOp.getWrapper();
            ElementInfo wrapperElement = wrapper.getInputWrapperElement();

            if (source == null) {
                Object targetWrapper = targetWrapperHandler.create(wrapperElement, context);
                return new Object[] {targetWrapper};
            }

            // If the source can be wrapped, wrapped it first
            if (sourceWrapperHandler != null) {
                DataType sourceWrapperType =
                    sourceWrapperHandler.getWrapperType(wrapperElement, wrapper.getInputChildElements(), context);
                if (sourceWrapperType != null) {
                    Object sourceWrapper = sourceWrapperHandler.create(wrapperElement, context);
                    if (sourceWrapper != null) {
                        for (int i = 0; i < source.length; i++) {
                            ElementInfo argElement = wrapper.getInputChildElements().get(i);
                            sourceWrapperHandler.setChild(sourceWrapper, i, argElement, source[i]);
                        }
                        Object targetWrapper =
                            mediator.mediate(sourceWrapper, sourceWrapperType, targetType.getLogical().get(0), context
                                .getMetadata());
                        return new Object[] {targetWrapper};
                    }
                }
            }
            // Fall back to child by child transformation
            Object targetWrapper = targetWrapperHandler.create(wrapperElement, context);
            List<DataType> argTypes = wrapper.getUnwrappedInputType().getLogical();

            for (int i = 0; i < source.length; i++) {
                ElementInfo argElement = wrapper.getInputChildElements().get(i);
                DataType<XMLType> argType = argTypes.get(i);
                Object child = source[i];
                child = mediator.mediate(source[i], sourceType.getLogical().get(i), argType, context.getMetadata());
                targetWrapperHandler.setChild(targetWrapper, i, argElement, child);
            }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

            operationModel.setInputType(getInputType());
            operationModel.setOutputType(getOutputType());

            operationModel.setWrapperStyle(isWrapperStyle());
            if (isWrapperStyle()) {
                WrapperInfo wrapperInfo = getWrapper().getWrapperInfo();
                operationModel.setWrapper(wrapperInfo);
            }
        }
        return operationModel;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

            List<ElementInfo> outputElements = new ArrayList<ElementInfo>();
            WebResult result = method.getAnnotation(WebResult.class);
            outputElements.add(new ElementInfo(new QName(result.targetNamespace(), result.name()), null));

            WrapperInfo wrapperInfo =
                new WrapperInfo(JAXB_DATABINDING, new ElementInfo(inputWrapper, null), new ElementInfo(outputWrapper,
                                                                                                       null),
                                inputElements, outputElements);
            operation.setWrapper(wrapperInfo);
            // operation.setDataBinding(JAXB_DATABINDING); // could be JAXB or SDO
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

                if (out != null) {
                    for (XmlSchemaElement e : getOutputChildElements()) {
                        outChildren.add(getElementInfo(e));
                    }
                }
                wrapperInfo = new WrapperInfo(dataBinding, in, out, inChildren, outChildren);
            }
            return wrapperInfo;
        }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

                        }

                    }
                }
                if (op.isWrapperStyle()) {
                    WrapperInfo wrapper = op.getWrapper();
                    if (wrapper != null) {
                        DataType<List<DataType>> unwrappedInputType = wrapper.getUnwrappedInputType();
                        if (unwrappedInputType != null) {
                            for (DataType d : unwrappedInputType.getLogical()) {
                                if (d.getDataBinding() == null) {
                                    d.setDataBinding(dataBinding);
                                }
                            }
                        }
                        DataType unwrappedOutputType = wrapper.getUnwrappedOutputType();
                        if (unwrappedOutputType != null && unwrappedOutputType.getDataBinding() == null) {
                            unwrappedOutputType.setDataBinding(dataBinding);
                        }
                    }
                }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

                    setDataBinding(d, dataBinding);
                    setDataBinding((DataType) d.getLogical(), dataBinding);
                }
            }
            if (op.isWrapperStyle()) {
                WrapperInfo wrapper = op.getWrapper();
                if (wrapper != null) {
                    DataType<List<DataType>> unwrappedInputType = wrapper.getUnwrappedInputType();
                    if (unwrappedInputType != null) {
                        for (DataType d : unwrappedInputType.getLogical()) {
                            setDataBinding(d, dataBinding);
                        }
                    }
                    DataType unwrappedOutputType = wrapper.getUnwrappedOutputType();
                    if (unwrappedOutputType != null) {
                        setDataBinding(unwrappedOutputType, dataBinding);
                    }
                }
            }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

            String targetDataBinding = getDataBinding(targetOp);
            targetWrapperHandler = getWrapperHandler(targetDataBinding, targetWrapped);

            if ((!sourceWrapped) && targetWrapped) {
                // Unwrapped --> Wrapped
                WrapperInfo wrapper = targetOp.getWrapper();
                ElementInfo wrapperElement = wrapper.getOutputWrapperElement();
                List<ElementInfo> childElements = wrapper.getOutputChildElements();

                // If the source can be wrapped, wrapped it first
                if (sourceWrapperHandler != null) {
                    DataType sourceWrapperType =
                        sourceWrapperHandler.getWrapperType(wrapperElement, childElements, context);
                    if (sourceWrapperType != null) {
                        Object sourceWrapper = sourceWrapperHandler.create(wrapperElement, context);
                        if (sourceWrapper != null) {
                            if (!childElements.isEmpty()) {
                                // Set the return value
                                ElementInfo returnElement = wrapper.getOutputChildElements().get(0);
                                sourceWrapperHandler.setChild(sourceWrapper, 0, returnElement, response);
                            }
                            Object targetWrapper =
                                mediator.mediate(sourceWrapper, sourceWrapperType, targetType.getLogical(), context
                                    .getMetadata());
                            return targetWrapper;
                        }
                    }
                }
                Object targetWrapper = targetWrapperHandler.create(wrapper.getOutputWrapperElement(), context);

                if (childElements.isEmpty()) {
                    // void output
                    return targetWrapper;
                }
                ElementInfo argElement = childElements.get(0);
                DataType<XMLType> argType = wrapper.getUnwrappedOutputType();
                Object child = response;
                child = mediator.mediate(response, sourceType.getLogical(), argType, context.getMetadata());
                targetWrapperHandler.setChild(targetWrapper, 0, argElement, child);
                return targetWrapper;
            } else if (sourceWrapped && (!targetWrapped)) {
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.