Package org.codehaus.xfire.service

Examples of org.codehaus.xfire.service.OperationInfo


        // TODO: This isn't too efficient. we need to only look at non headers here
        // TODO: filter out operations which aren't applicable
        MessagePartInfo lastChoice = null;
        for ( Iterator itr = operations.iterator(); itr.hasNext(); )
        {
            OperationInfo op = (OperationInfo) itr.next();
            MessageInfo msgInfo = null;
            if (isClientModeOn(context))
            {
                msgInfo = op.getOutputMessage();
            }
            else
            {
                msgInfo = op.getInputMessage();
            }

            Collection bodyParts = msgInfo.getMessageParts();
            if (bodyParts.size() == 0 || bodyParts.size() <= index)
            {
View Full Code Here


    protected void read(InMessage inMessage, MessageContext context, Collection operations)
        throws XFireFault
    {
        List parameters = new ArrayList();
        OperationInfo opInfo = context.getExchange().getOperation();
       
        DepthXMLStreamReader dr = new DepthXMLStreamReader(context.getInMessage().getXMLStreamReader());
        int param = 0;
        boolean clientMode = isClientModeOn(context);
       
        while (STAXUtils.toNextElement(dr))
        {
            MessagePartInfo p;
           
            if (opInfo != null && clientMode)
            {
                p = (MessagePartInfo) opInfo.getOutputMessage().getMessageParts().get(param);
            }
            else if (opInfo != null && !clientMode)
            {
                p = (MessagePartInfo) opInfo.getInputMessage().getMessageParts().get(param);
            }
            else
            {
                // Try to intelligently find the right part if we don't know the operation yet.
                p = findMessagePart(context, operations, dr.getName(), param);
View Full Code Here

            for (int i = 0; i < bindingOperations.size(); i++)
            {
                BindingOperation bindingOperation =
                    (BindingOperation) bindingOperations.get(i);
                String opName = bindingOperation.getOperation().getName();
                OperationInfo opInfo = serviceInfo.getOperation(opName);
               
                if (opInfo == null)
                {
                    throw new XFireRuntimeException("Could not find operation " + opName + " in the service model.");
                }
               
                ann.visit(bindingOperation, opInfo);
               
                ann.visit(bindingOperation.getBindingInput(),
                          bindingOperation.getOperation().getInput(),
                          opInfo.getInputMessage());
               
                if (opInfo.hasOutput())
                {
                    ann.visit(bindingOperation.getBindingOutput(),
                              bindingOperation.getOperation().getOutput(),
                              opInfo.getOutputMessage());
                }
               
                Collection bindingFaults = bindingOperation.getBindingFaults().values();
                for (Iterator iterator2 = bindingFaults.iterator(); iterator2.hasNext();)
                {
                    BindingFault bindingFault = (BindingFault) iterator2.next();
                    Fault fault = bindingOperation.getOperation().getFault(bindingFault.getName());
                    FaultInfo faultInfo = opInfo.getFault(fault.getName());
                   
                    ann.visit(bindingFault, fault, faultInfo);
                }

            }
View Full Code Here

        def.addPortType(portType);

        // Create Abstract operations
        for (Iterator itr = service.getServiceInfo().getOperations().iterator(); itr.hasNext();)
        {
            OperationInfo op = (OperationInfo) itr.next();
           

            // Create input message
            Message req = createInputMessage(op);
            def.addMessage(req);
          
          
           
            // Create output message if we have an out MEP
            Message res = null;
            if (op.getMEP().equals(SoapConstants.MEP_ROBUST_IN_OUT))
            {
                res = createOutputMessage(op);
                def.addMessage(res);
            }

            // Create the fault messages
            List faultMessages = new ArrayList();
            for (Iterator faultItr = op.getFaults().iterator(); faultItr.hasNext();)
            {
                FaultInfo fault = (FaultInfo) faultItr.next();
                Fault faultMsg = createFault(op, fault);
                if( fault.getDocumentation()!= null ){
                    faultMsg.setDocumentationElement(createElement(fault.getDocumentation()));   
                }
               
                faultMessages.add(faultMsg);
            }

            javax.wsdl.Operation wsdlOp = createOperation(op, req, res, faultMessages);
            wsdlOp.setUndefined(false);
            portType.addOperation(wsdlOp);
           
            String opDoc  = op.getDocumenation();
            if( opDoc != null ){
                wsdlOp.setDocumentationElement(createElement(opDoc));   
            }
           
            wsdlOps.put(op.getName(), wsdlOp);
        }

        return portType;
    }
View Full Code Here

     */
    public void initialize(Service endpoint)
    {
        for (Iterator itr = endpoint.getServiceInfo().getOperations().iterator(); itr.hasNext();)
        {
            OperationInfo opInfo = (OperationInfo) itr.next();
            try
            {
                initializeMessage(endpoint, opInfo.getInputMessage(), IN_PARAM);
            }
            catch(XFireRuntimeException e)
            {
                e.prepend("Error initializing parameters for method " + opInfo.getMethod());
                throw e;
            }
           
            try
            {
                if (opInfo.hasOutput())
                    initializeMessage(endpoint, opInfo.getOutputMessage(), OUT_PARAM);
            }
            catch(XFireRuntimeException e)
            {
                e.prepend("Error initializing return value for method " + opInfo.getMethod());
                throw e;
            }
           
            try
            {
                for (Iterator faultItr = opInfo.getFaults().iterator(); faultItr.hasNext();)
                {
                    FaultInfo info = (FaultInfo) faultItr.next();
                    initializeMessage(endpoint, info, FAULT_PARAM);
                }
            }
            catch(XFireRuntimeException e)
            {
                e.prepend("Error initializing fault for method " + opInfo.getMethod());
                throw e;
            }
        }
    }
View Full Code Here

    public void initialize(Service endpoint, Binding binding)
    {
        for (Iterator itr = endpoint.getServiceInfo().getOperations().iterator(); itr.hasNext();)
        {
            OperationInfo opInfo = (OperationInfo) itr.next();
           
            initializeMessage(endpoint, binding.getHeaders(opInfo.getInputMessage()), IN_PARAM);
           
            if (opInfo.hasOutput())
            {
                initializeMessage(endpoint, binding.getHeaders(opInfo.getOutputMessage()), OUT_PARAM);
            }
        }
    }
View Full Code Here

        annotate(context, service, jc, binding);
       
        // Process operations
        for (Iterator itr = serviceInfo.getOperations().iterator(); itr.hasNext();)
        {
            OperationInfo op = (OperationInfo) itr.next();
           
            JType returnType = getReturnType(context, schema, op);
           
            String name = javify(op.getName());
            name = name.substring(0, 1).toLowerCase() + name.substring(1);
           
            JMethod method = jc.method(JMod.PUBLIC, returnType, name);
           
            String opDocumentation = op.getDocumenation();
            if( opDocumentation != null ){
                method.javadoc().add(opDocumentation);
            }
            annotate(context, op, method);
           
View Full Code Here

    {
        for (Service service : services)
        {
            for (Iterator itr = service.getServiceInfo().getOperations().iterator(); itr.hasNext();)
            {
                OperationInfo op = (OperationInfo) itr.next();
               
                for (Iterator fitr = op.getFaults().iterator(); fitr.hasNext();)
                {
                    FaultInfo fault = (FaultInfo) fitr.next();
                   
                    List messageParts = fault.getMessageParts();
                   
                    if (messageParts.size() == 0)
                    {
                        throw new IllegalStateException("Fault does not contain a message part: " + service.getName() + " / " + op.getName() + " / " + fault.getName());
                    }
                    MessagePartInfo part = (MessagePartInfo) messageParts.get(0);
                   
                    if (!exClasses.containsKey(fault.getMessageName()))
                    {
View Full Code Here

        {
            Binding b = (Binding) itr.next();
           
            for (Iterator oitr = service.getServiceInfo().getOperations().iterator(); oitr.hasNext();)
            {
                OperationInfo op = (OperationInfo) oitr.next();
               
                configureHeaders(service, op, b);
            }
           
            if (b instanceof AbstractSoapBinding)
View Full Code Here

        binding.setSerializer(getSerializer(binding));

        // Create SOAP metadata for the binding operation
        for (Iterator itr = serviceInfo.getOperations().iterator(); itr.hasNext();)
        {
            OperationInfo op = (OperationInfo) itr.next();
           
            createBindingOperation(service, binding, op);
        }
   
        service.addBinding(binding);
View Full Code Here

TOP

Related Classes of org.codehaus.xfire.service.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.