Examples of MessageContentsList


Examples of org.apache.cxf.message.MessageContentsList

        } else {
            msg = operation.getOperationInfo().getOutput();
        }
        message.put(MessageInfo.class, msg);
       
        MessageContentsList parameters = new MessageContentsList();

        StaxUtils.nextEvent(xmlReader);
       
        boolean hasNext = true;
        Iterator<MessagePartInfo> itr = msg.getMessageParts().iterator();
        while (itr.hasNext()) {
            MessagePartInfo part = itr.next();
            if (hasNext) {
                hasNext = StaxUtils.toNextElement(xmlReader);
            }

            if (hasNext) {
                QName qn = xmlReader.getName();
                if (qn.equals(SOAP12_RESULT)) {
                    //just ignore this.   The parts should work correctly.
                    try {
                        while (xmlReader.getEventType() != XMLStreamReader.END_ELEMENT) {
                            xmlReader.next();
                        }
                        xmlReader.next();
                    } catch (XMLStreamException e) {
                        //ignore
                    }
                    StaxUtils.toNextElement(xmlReader);
                    qn = xmlReader.getName();
                }
               
               
                // WSI-BP states that RPC/Lit part accessors should be completely unqualified
                // However, older toolkits (Axis 1.x) are qualifying them.   We'll go
                // ahead and just match on the localpart.   The RPCOutInterceptor
                // will always generate WSI-BP compliant messages so it's unknown if
                // the non-WSI-BP toolkits will be able to understand the CXF
                // generated messages if they are expecting it to be qualified.
                while (!qn.getLocalPart().equals(part.getConcreteName().getLocalPart())
                    && itr.hasNext()) {
                    part = itr.next();
                }
                if (!qn.equals(part.getConcreteName())) {
                    throw new Fault(
                                    new org.apache.cxf.common.i18n.Message(
                                                                           "UNKNOWN_RPC_LIT_PART",
                                                                           LOG,
                                                                           qn));
                }
                try {
                    parameters.put(part, dr.read(part, xmlReader));
                } catch (Fault f) {
                    if (!isRequestor(message)) {
                        f.setFaultCode(Fault.FAULT_CODE_CLIENT);
                    }
                    throw f;
View Full Code Here

Examples of org.apache.cxf.message.MessageContentsList

                CxfPayload<?> payload = (CxfPayload<?>) params[0];
                List<Source> elements = payload.getBodySources();

                BindingOperationInfo boi = message.get(BindingOperationInfo.class);
                MessageContentsList content = new MessageContentsList();
                int i = 0;

                for (MessagePartInfo partInfo : boi.getInput().getMessageParts()) {
                    if (elements.size() > i) {
                        if (isSkipPayloadMessagePartCheck()) {
                            content.put(partInfo, elements.get(i++));
                        } else {
                            String name = findName(elements, i);
                            if (partInfo.getConcreteName().getLocalPart().equals(name)) {
                                content.put(partInfo, elements.get(i++));
                            }
                        }
                    }
                }

                if (elements != null && content.size() < elements.size()) {
                    throw new IllegalArgumentException("The PayLoad elements cannot fit with the message parts of the BindingOperation. Please check the BindingOperation and PayLoadMessage.");
                }

                message.setContent(List.class, content);
                message.put(Header.HEADER_LIST, payload.getHeaders());
View Full Code Here

Examples of org.apache.cxf.message.MessageContentsList

       
        camelMessage.setHeader(CxfConstants.OPERATION_NAME, method.getName());
       
        camelMessage.setHeader(CxfConstants.CAMEL_CXF_MESSAGE, cxfMessage);
       
        camelMessage.setBody(new MessageContentsList(paramArray));       
    }
View Full Code Here

Examples of org.apache.cxf.message.MessageContentsList

            } else {
                if (responseContext.get(Header.HEADER_LIST) != null) {
                    outMessage.put(Header.HEADER_LIST, responseContext.get(Header.HEADER_LIST));
                }

                MessageContentsList resList = null;
                // Create a new MessageContentsList to avoid OOM from the HolderOutInterceptor
                if (outBody instanceof List) {
                    resList = new MessageContentsList((List<?>)outBody);
                } else if (outBody.getClass().isArray()) {
                    resList = new MessageContentsList((Object[])outBody);
                } else {
                    resList = new MessageContentsList(outBody);
                }

                if (resList != null) {
                    outMessage.setContent(List.class, resList);
                    LOG.trace("Set Out CXF message content = {}", resList);
View Full Code Here

Examples of org.apache.cxf.message.MessageContentsList

        if (boi.isUnwrapped()) {
            boi = boi.getWrappedOperation();
            exchange.put(BindingOperationInfo.class, boi);
        }
       
        MessageContentsList answer = new MessageContentsList();

        int i = 0;
        if (boi.getOutput() != null) {
            for (MessagePartInfo partInfo : boi.getOutput().getMessageParts()) {
                if (elements != null && elements.size() > i) {
                    answer.put(partInfo, elements.get(i++));
                }
            }
        }

        return answer;
View Full Code Here

Examples of org.apache.cxf.message.MessageContentsList

            if (dataFormat == DataFormat.POJO) {
                answer = message.getContent(List.class)
                if (answer == null) {
                    answer = message.getContent(Object.class);
                    if (answer != null) {
                        answer = new MessageContentsList(answer);
                    }
                }
            } else if (dataFormat == DataFormat.PAYLOAD) {
                List<SoapHeader> headers = CastUtils.cast((List<?>)message.get(Header.HEADER_LIST));
                Map<String, String> nsMap = new HashMap<String, String>();
View Full Code Here

Examples of org.apache.cxf.message.MessageContentsList

                      && !node.getNodeValue().equals(Soap12.SOAP_NAMESPACE)) {
                    nsMap.put(node.getLocalName(), node.getNodeValue());
                }
            }
        }
        MessageContentsList inObjects = MessageContentsList.getContentsList(message);
        if (inObjects == null) {
            return new ArrayList<Source>(0);
        }
        org.apache.cxf.message.Exchange exchange = message.getExchange();
        BindingOperationInfo boi = exchange.getBindingOperationInfo();

        OperationInfo op = boi.getOperationInfo();
       
        if (boi.isUnwrapped()) {
            op = boi.getWrappedOperation().getOperationInfo();
        }

        List<MessagePartInfo> partInfos = null;
        boolean client = Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE));
        if (client) {
            // it is a response
            partInfos = op.getOutput().getMessageParts();           
           
        } else {
            // it is a request
            partInfos = op.getInput().getMessageParts();           
        }
       
        List<Source> answer = new ArrayList<Source>();

        for (MessagePartInfo partInfo : partInfos) {
            if (!inObjects.hasValue(partInfo)) {
                continue;
            }
           
            Object part = inObjects.get(partInfo);
           
            if (part instanceof Holder) {
                part = ((Holder<?>)part).value;
            }
                       
View Full Code Here

Examples of org.apache.cxf.message.MessageContentsList

                CxfPayload<?> payload = (CxfPayload<?>) params[0];
                List<Source> elements = payload.getBodySources();

                BindingOperationInfo boi = message.get(BindingOperationInfo.class);
                MessageContentsList content = new MessageContentsList();
                int i = 0;

                for (MessagePartInfo partInfo : boi.getInput().getMessageParts()) {
                    if (elements.size() > i) {
                        if (isSkipPayloadMessagePartCheck()) {
                            content.put(partInfo, elements.get(i++));
                        } else {
                            String name = findName(elements, i);
                            if (partInfo.getConcreteName().getLocalPart().equals(name)) {
                                content.put(partInfo, elements.get(i++));
                            }
                        }
                    }
                }

                if (elements != null && content.size() < elements.size()) {
                    throw new IllegalArgumentException("The PayLoad elements cannot fit with the message parts of the BindingOperation. Please check the BindingOperation and PayLoadMessage.");
                }

                message.setContent(List.class, content);
                message.put(Header.HEADER_LIST, payload.getHeaders());
View Full Code Here

Examples of org.apache.cxf.message.MessageContentsList

        BindingOperationInfo boi = (BindingOperationInfo)exchange.getProperty(BindingOperationInfo.class.toString());
        if (boi != null) {
            LOG.info("boi.isUnwrapped" + boi.isUnwrapped());
        }
        // Get the parameters list which element is the holder.
        MessageContentsList msgList = (MessageContentsList)exchange.getIn().getBody();
        Holder<String> personId = (Holder<String>)msgList.get(0);
        Holder<String> ssn = (Holder<String>)msgList.get(1);
        Holder<String> name = (Holder<String>)msgList.get(2);

        if (personId.value == null || personId.value.length() == 0) {
            LOG.info("person id 123, so throwing exception");
            // Try to throw out the soap fault message
            org.apache.camel.wsdl_first.types.UnknownPersonFault personFault =
View Full Code Here

Examples of org.apache.cxf.message.MessageContentsList

            } else {
                if (responseContext.get(Header.HEADER_LIST) != null) {
                    outMessage.put(Header.HEADER_LIST, responseContext.get(Header.HEADER_LIST));
                }

                MessageContentsList resList = null;
                // Create a new MessageContentsList to avoid OOM from the HolderOutInterceptor
                if (outBody instanceof List) {
                    resList = new MessageContentsList((List<?>)outBody);
                } else if (outBody.getClass().isArray()) {
                    resList = new MessageContentsList((Object[])outBody);
                } else {
                    resList = new MessageContentsList(outBody);
                }

                if (resList != null) {
                    outMessage.setContent(List.class, resList);
                    LOG.trace("Set Out CXF message content = {}", resList);
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.