Package org.apache.cxf.service.model

Examples of org.apache.cxf.service.model.OperationInfo


        }
        return false;  
    }
   
    protected ObjectName getOperationCounterName(Exchange ex, ObjectName sericeCounterName) {
        OperationInfo opInfo = ex.get(OperationInfo.class);
        String operationName = opInfo == null ? null : "\"" + opInfo.getName().getLocalPart() + "\"";

        if (operationName == null) {
            Object nameProperty = ex.get("org.apache.cxf.resource.operation.name");
            if (nameProperty != null) {
                operationName = "\"" + escapePatternChars(nameProperty.toString()) + "\"";
View Full Code Here


        }
        boolean isFromWrapper = part.getMessageInfo().getOperation().isUnwrapped();
        if (isFromWrapper
            && !Boolean.TRUE.equals(part.getProperty("messagepart.isheader"))) {
            UnwrappedOperationInfo uop = (UnwrappedOperationInfo)part.getMessageInfo().getOperation();
            OperationInfo op = uop.getWrappedOperation();
            MessageInfo inf = null;
            if (uop.getInput() == part.getMessageInfo()) {
                inf = op.getInput();
            } else if (uop.getOutput() == part.getMessageInfo()) {
                inf = op.getOutput();
            }
            if (inf != null
                && inf.getMessagePart(0).getTypeClass() != null) {
                //if the wrapper has a type class, we don't need to do anything
                //as everything would have been discovered when walking the
View Full Code Here

        }

    }

    private void buildInterfaceOperation(InterfaceInfo inf, Operation op) {
        OperationInfo opInfo = inf.addOperation(new QName(inf.getName().getNamespaceURI(), op.getName()));
        if (recordOriginal) {
            opInfo.setProperty(WSDL_OPERATION, op);
        }
        List<String> porderList = CastUtils.cast((List)op.getParameterOrdering());
        opInfo.setParameterOrdering(porderList);
        this.copyExtensors(opInfo, op.getExtensibilityElements());
        this.copyExtensionAttributes(opInfo, op);
        Input input = op.getInput();
        if (input != null) {
            if (input.getMessage() == null) {
                throw new WSDLRuntimeException(LOG, "NO_MESSAGE", "input", op.getName(), input.getName());
            }
            MessageInfo minfo = opInfo.createMessage(input.getMessage().getQName(), MessageInfo.Type.INPUT);
            opInfo.setInput(input.getName(), minfo);
            buildMessage(minfo, input.getMessage());
            copyExtensors(minfo, input.getExtensibilityElements());
            copyExtensionAttributes(minfo, input);
        }
        Output output = op.getOutput();
        if (output != null) {
            if (output.getMessage() == null) {
                throw new WSDLRuntimeException(LOG, "NO_MESSAGE", "output", op.getName(), output.getName());
            }
            MessageInfo minfo = opInfo.createMessage(output.getMessage().getQName(), MessageInfo.Type.OUTPUT);
            opInfo.setOutput(output.getName(), minfo);
            buildMessage(minfo, output.getMessage());
            copyExtensors(minfo, output.getExtensibilityElements());
            copyExtensionAttributes(minfo, output);
        }
        Map<?, ?> m = op.getFaults();
        for (Map.Entry<?, ?> rawentry : m.entrySet()) {
            Map.Entry<String, Fault> entry = cast(rawentry, String.class, Fault.class);
            FaultInfo finfo = opInfo.addFault(new QName(inf.getName().getNamespaceURI(), entry.getKey()),
                                              entry.getValue().getMessage().getQName());
            buildMessage(finfo, entry.getValue().getMessage());
            copyExtensors(finfo, entry.getValue().getExtensibilityElements());
            copyExtensionAttributes(finfo, entry.getValue());
        }
View Full Code Here

        // RULE No.4 and No5:
        // wrapper element should be pure complex type

        // Now lets see if we have any attributes...
        // This should probably look at the restricted and substitute types too.
        OperationInfo unwrapped = new UnwrappedOperationInfo(opInfo);
        MessageInfo unwrappedInput = new MessageInfo(unwrapped, MessageInfo.Type.INPUT,
                                                     inputMessage.getName());
        MessageInfo unwrappedOutput = null;

        XmlSchemaComplexType xsct = null;
        if (inputEl.getSchemaType() instanceof XmlSchemaComplexType) {
           
            xsct = (XmlSchemaComplexType)inputEl.getSchemaType();
            if (hasAttributes(xsct)
                || (inputEl.isNillable() && !relaxed)
                || !isWrappableSequence(xsct, inputEl.getQName().getNamespaceURI(),
                                        unwrappedInput, allowRefs)) {
                passedRule = false;
            }
        } else {
            passedRule = false;
        }

        if (!passedRule) {
            return;
        }

        if (outputMessage != null) {
            unwrappedOutput = new MessageInfo(unwrapped, MessageInfo.Type.OUTPUT, outputMessage.getName());

            if (outputEl != null && outputEl.getSchemaType() instanceof XmlSchemaComplexType) {
                xsct = (XmlSchemaComplexType)outputEl.getSchemaType();
                if (xsct.isAbstract()) {
                    passedRule = false;
                }
                if (hasAttributes(xsct)
                    || (outputEl.isNillable() && !relaxed)
                    || !isWrappableSequence(xsct, outputEl.getQName().getNamespaceURI(), unwrappedOutput,
                                            allowRefs)) {
                    passedRule = false;
                }
            } else {
                passedRule = false;
            }
        }

        if (!passedRule) {
            return;
        }
        // we are wrappable!!
        opInfo.setUnwrappedOperation(unwrapped);
        unwrapped.setInput(opInfo.getInputName(), unwrappedInput);
        if (outputMessage != null) {
            unwrapped.setOutput(opInfo.getOutputName(), unwrappedOutput);
        }
    }
View Full Code Here

           
            end(f);
        }
       
        if (o.isUnwrappedCapable()) {
            OperationInfo uop = o.getUnwrappedOperation();
            begin(uop);
            visitOperation(o.getUnwrappedOperation());
            end(uop);
        }
    }
View Full Code Here

            minfo = new MessageInfo(null, type, msg.getQName());
        }
        buildMessage(minfo, msg, schemas, nextId, partName);

        // for wrapped style
        OperationInfo unwrapped = bop.getOperationInfo().getUnwrappedOperation();
        if (unwrapped == null) {
            return;
        }
       
        nextId = 0;
        minfo = unwrapped.getInput();
        if (minfo != null) {
            for (MessagePartInfo part : minfo.getMessageParts()) {
                if (part.getIndex() >= nextId) {
                    nextId = part.getIndex() + 1;
                }
            }
        }
        minfo = unwrapped.getOutput();
        if (minfo != null) {
            for (MessagePartInfo part : minfo.getMessageParts()) {
                if (part.getIndex() >= nextId) {
                    nextId = part.getIndex() + 1;
                }
            }
        }
       
       
       
        if (isInput) {
            minfo = unwrapped.getInput();
            type = MessageInfo.Type.INPUT;
        } else {
            minfo = unwrapped.getOutput();
            type = MessageInfo.Type.OUTPUT;
        }

        if (minfo == null) {
            minfo = new MessageInfo(unwrapped, type, msg.getQName());
View Full Code Here

        Endpoint ep = exchange.get(Endpoint.class);
        MessagePartInfo lastChoice = null;
        BindingMessageInfo msgInfo = null;
        BindingOperationInfo boi = null;
        for (Iterator<OperationInfo> itr = operations.iterator(); itr.hasNext();) {
            OperationInfo op = itr.next();

            boi = ep.getEndpointInfo().getBinding().getOperation(op);
            if (boi == null) {
                continue;
            }
            if (client) {
                msgInfo = boi.getOutput();
            } else {
                msgInfo = boi.getInput();
            }

            if (msgInfo == null) {
                itr.remove();
                continue;
            }
           
            Collection bodyParts = msgInfo.getMessageParts();
            if (bodyParts.size() == 0 || bodyParts.size() <= index) {
                itr.remove();
                continue;
            }

            MessagePartInfo p = (MessagePartInfo)msgInfo.getMessageParts().get(index);
            if (name.getNamespaceURI() == null || name.getNamespaceURI().length() == 0) {
                // message part has same namespace with the message
                name = new QName(p.getMessageInfo().getName().getNamespaceURI(), name.getLocalPart());
            }
            if (name.equals(p.getConcreteName())) {
                exchange.put(BindingOperationInfo.class, boi);
                exchange.put(OperationInfo.class, boi.getOperationInfo());
                exchange.setOneWay(op.isOneWay());
                return p;
            }

            if (XSD_ANY.equals(p.getTypeQName())) {
                lastChoice = p;
View Full Code Here

        return getMessageInfo(message, operation, isRequestor(message));
    }

    protected MessageInfo getMessageInfo(Message message, BindingOperationInfo operation, boolean requestor) {
        MessageInfo msgInfo;
        OperationInfo intfOp = operation.getOperationInfo();
        if (requestor) {
            msgInfo = intfOp.getOutput();
            message.put(MessageInfo.class, intfOp.getOutput());
        } else {
            msgInfo = intfOp.getInput();
            message.put(MessageInfo.class, intfOp.getInput());
        }
        return msgInfo;
    }
View Full Code Here

            inMsg.putAll(m);
   
            inMsg.put(COLOCATED, Boolean.TRUE);
            inMsg.put(Message.REQUESTOR_ROLE, Boolean.FALSE);
            inMsg.put(Message.INBOUND_MESSAGE, Boolean.TRUE);
            OperationInfo oi = ex.get(OperationInfo.class);
            if (oi != null) {
                inMsg.put(MessageInfo.class, oi.getInput());
            }
            ex.setInMessage(inMsg);
            inMsg.setExchange(ex);
           
            if (LOG.isLoggable(Level.FINEST)) {
                LOG.finest("Build inbound interceptor chain.");
            }
   
            //Add all interceptors between USER_LOGICAL and INVOKE.
            SortedSet<Phase> phases = new TreeSet<Phase>(bus.getExtension(PhaseManager.class).getInPhases());
            ColocUtil.setPhases(phases, Phase.USER_LOGICAL, Phase.INVOKE);
            InterceptorChain chain = ColocUtil.getInInterceptorChain(ex, phases);
            chain.add(addColocInterceptors());
            inMsg.setInterceptorChain(chain);
   
            //Convert the coloc object type if necessary
            OperationInfo soi = m.getExchange().get(OperationInfo.class);
            if (soi != null && oi != null) {
                if (ColocUtil.isAssignableOperationInfo(soi, Source.class)
                    && !ColocUtil.isAssignableOperationInfo(oi, Source.class)) {
                    // converting source -> pojo
                    ColocUtil.convertSourceToObject(inMsg);
View Full Code Here

        content.set(0, new StreamSource(new ByteArrayInputStream(bos.toByteArray())));
    }
   
    private static MessageInfo getMessageInfo(Message message) {
        OperationInfo oi = message.getExchange().get(OperationInfo.class);
        if (MessageUtils.isOutbound(message)) {
            return oi.getOutput();
        } else {
            return oi.getInput();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.service.model.OperationInfo

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.