Package org.apache.wsdl

Examples of org.apache.wsdl.WSDLOperation


            AxisOperation axisOperation = (AxisOperation) operations.next();
            if (axisOperation.isControlOperation()) {
                // we do not need to expose control operation in the WSDL
                continue;
            }
            WSDLOperation wsdlOperation = womDescription.createOperation();
            wsdlOperation.setName(axisOperation.getName());

            // adding policies defined in wsdl:portType -> wsdl:operation
            include = axisOperation.getPolicyInclude();

            policyElements = include.getPolicyElements(PolicyInclude.OPERATION_POLICY);
            addPolicyAsExtElements(womDescription, policyElements, wsdlOperation, include);

            AxisMessage inaxisMessage = axisOperation
                    .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            if (inaxisMessage != null) {
                MessageReference messageRefinput = wsdlComponentFactory
                        .createMessageReference();
                messageRefinput
                        .setElementQName(inaxisMessage.getElementQName());
                messageRefinput
                        .setDirection(WSDLConstants.WSDL_MESSAGE_DIRECTION_IN);

                // adding policies defined in wsdl:portType -> wsdl:operation ->
                // wsdl:input
                include = inaxisMessage.getPolicyInclude();

                policyElements = include.getPolicyElements(PolicyInclude.INPUT_POLICY);
                addPolicyAsExtAttributes(womDescription, policyElements, messageRefinput, include);

                wsdlOperation.setInputMessage(messageRefinput);
            }

            try {
                AxisMessage outaxisMessage = axisOperation
                        .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                if (outaxisMessage != null
                        && outaxisMessage.getElementQName() != null) {
                    MessageReference messageRefout = wsdlComponentFactory
                            .createMessageReference();
                    messageRefout.setElementQName(outaxisMessage
                            .getElementQName());
                    messageRefout
                            .setDirection(WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);

                    // adding policies defined in wsdl:portType -> wsdl:operation
                    // -> wsdl:output
                    include = outaxisMessage.getPolicyInclude();

                    policyElements = include.getPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY);
                    addPolicyAsExtAttributes(womDescription, policyElements, messageRefout, include);

                    wsdlOperation.setOutputMessage(messageRefout);
                }
            } catch (UnsupportedOperationException e) {
                // operation does not have an out message so , no need to do
                // anything here
            }
View Full Code Here


        binding.addExtensibilityElement(soapbindingImpl);

        Iterator op_itr = portType.getOperations().keySet().iterator();
        while (op_itr.hasNext()) {
            String opName = (String) op_itr.next();
            WSDLOperation wsdlOperation = portType.getOperation(opName);
            MessageReference inMessage = wsdlOperation.getInputMessage();

            WSDLBindingOperation bindingoperation = wsdlComponentFactory
                    .createWSDLBindingOperation();
            bindingoperation.setName(new QName(opName));
            bindingoperation.setOperation(wsdlOperation);

            AxisOperation axisOperation = axisService.getOperation(new QName(
                    opName));
            include = axisOperation.getPolicyInclude();

            // adding policies defined in operation element in services.xml
            policyElementsList = include
                    .getPolicyElements(PolicyInclude.AXIS_OPERATION_POLICY);
            addPolicyAsExtElements(womDescription, policyElementsList,
                    bindingoperation, include);

            // adding policies defined in wsdl:binding -> wsdl:operation
            policyElementsList = include
                    .getPolicyElements(PolicyInclude.BINDING_OPERATION_POLICY);
            addPolicyAsExtElements(womDescription, policyElementsList,
                    bindingoperation, include);

            binding.addBindingOperation(bindingoperation);

            SOAPOperation soapOpimpl = (SOAPOperation) extensionFactory
                    .getExtensionElement(ExtensionConstants.SOAP_11_OPERATION);
            soapOpimpl.setStyle(style);
            // to do heve to set a proper SOAPAction
            ArrayList wsamappingList = axisOperation.getWsamappingList();
            if (wsamappingList != null && wsamappingList.size() > 0) {
                soapOpimpl.setSoapAction((String) wsamappingList.get(0));
            } else {
                soapOpimpl.setSoapAction(opName);
            }
            bindingoperation.addExtensibilityElement(soapOpimpl);

            if (inMessage != null) {
                WSDLBindingMessageReference bindingInMessage = wsdlComponentFactory
                        .createWSDLBindingMessageReference();
                bindingInMessage
                        .setDirection(WSDLConstants.WSDL_MESSAGE_DIRECTION_IN);
                bindingoperation.setInput(bindingInMessage);

                SOAPBody requestSoapbody = (SOAPBody) extensionFactory
                        .getExtensionElement(ExtensionConstants.SOAP_11_BODY);
                requestSoapbody.setUse(use);
                requestSoapbody.setNamespaceURI(namespeceURI);
                bindingInMessage.addExtensibilityElement(requestSoapbody);

                AxisMessage axisInMessage = axisOperation
                        .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                include = axisInMessage.getPolicyInclude();

                // adding policies defined in message element in services.xml
                policyElementsList = include
                        .getPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY);
                addPolicyAsExtElements(womDescription, policyElementsList,
                        inMessage, include);

                // adding policies defined in wsdl:binding -> wsdl:operation ->
                // wsdl:input
                policyElementsList = include
                        .getPolicyElements(PolicyInclude.BINDING_INPUT_POLICY);
                addPolicyAsExtElements(womDescription, policyElementsList,
                        inMessage, include);

            }

            MessageReference outMessage = wsdlOperation.getOutputMessage();
            if (outMessage != null) {
                WSDLBindingMessageReference bindingOutMessage = wsdlComponentFactory
                        .createWSDLBindingMessageReference();

                bindingOutMessage
View Full Code Here

        //Copied with the Same QName so it will require no Query in Binding
        //Coping.
        wsdlInterface.setName(wsdl4jPortType.getQName());
        Iterator wsdl4JOperationsIterator =
                wsdl4jPortType.getOperations().iterator();
        WSDLOperation wsdloperation;
        Operation wsdl4jOperation;

        while (wsdl4JOperationsIterator.hasNext()) {
            wsdloperation = this.wsdlComponentFactory.createOperation();
            wsdl4jOperation = (Operation) wsdl4JOperationsIterator.next();
View Full Code Here

        } else {
            Iterator superIterator =
                    this.superInterfaces.values().iterator();
            Iterator operationIterator;
            WSDLInterface superInterface;
            WSDLOperation superInterfaceOperation;
            WSDLOperation thisOperation;
            boolean tobeAdded = false;
            while (superIterator.hasNext()) {
                superInterface = (WSDLInterface) superIterator.next();
                operationIterator =
                        superInterface.getAllOperations().values().iterator();
                while (operationIterator.hasNext()) {
                    superInterfaceOperation =
                            (WSDLOperation) operationIterator.next();
                    tobeAdded = true;
                    Iterator thisIterator = all.values().iterator();
                    while (thisIterator.hasNext()) {
                        thisOperation = (WSDLOperation) thisIterator.next();
                        if ((thisOperation.getName() ==
                                superInterfaceOperation.getName())
                                && !tobeAdded) {
                            if (thisOperation.getTargetnamespace().equals(
                                    superInterfaceOperation.getTargetnamespace())) {

                                // Both are the same Operation; the one inherited and
                                // the one that is already in the map(may or maynot be inherited)
                                tobeAdded = false;
View Full Code Here

                while (interfaceIterator.hasNext()) {
                    wsdlInterface = (WSDLInterface) interfaceIterator.next();
                    Map opMap = wsdlInterface.getOperations();
                    if (!opMap.isEmpty()) {
                        Iterator opIterator = opMap.values().iterator();
                        WSDLOperation operation;
                        while (opIterator.hasNext()) {
                            operation = (WSDLOperation) opIterator.next();
                            //populate the symbol table of Messages
                            QName inputReference = operation.getInputMessage() == null ? null : operation.getInputMessage().getElementQName();
                            if (inputReference != null) {
                                populateMessageSymbol(inputReference);
                            }

                            QName outputReference = operation.getOutputMessage() == null ? null : operation.getOutputMessage().getElementQName();
                            if (outputReference != null) {
                                populateMessageSymbol(outputReference);
                            }

                            //todo handle the faults here
View Full Code Here

     */
    protected void writePorttypeOperations(WSDLInterface wsdlInterface) throws XMLStreamException, IOException {
        Map operationsMap = wsdlInterface.getOperations();
        if (!operationsMap.isEmpty()) {
            Iterator opIterator = operationsMap.values().iterator();
            WSDLOperation operation;
            while (opIterator.hasNext()) {
                operation = (WSDLOperation) opIterator.next();
                writer.writeStartElement(defaultWSDLPrefix, OPERATION_NAME, WSDL1_1_NAMESPACE_URI);
                writer.writeAttribute("name", operation.getName() == null ? "" : operation.getName().getLocalPart());
//                writer.writeEndElement();
                //write the inputs
                //write extensibility elements
                handleExtensibiltyElements(operation.getExtensibilityElements());
                WSDL11Message message;
                MessageReference inputMessage = operation.getInputMessage();
                if (inputMessage != null) {
                    message = (WSDL11Message) messageMap.get(inputMessage.getElementQName());
                    writer.writeStartElement(defaultWSDLPrefix, INPUT_NAME, WSDL1_1_NAMESPACE_URI);
                    writer.writeAttribute("message", targetNamespacePrefix + ":" + message.getMessageName());
                    //write extensibility attributes
                    handleExtensibilityAttributes(inputMessage.getExtensibilityAttributes());
                    writer.writeEndElement();
                }

                //write the outputs
                MessageReference outputMessage = operation.getOutputMessage();
                if (outputMessage != null) {
                    message = (WSDL11Message) messageMap.get(outputMessage.getElementQName());
                    writer.writeStartElement(defaultWSDLPrefix, OUTPUT_NAME, WSDL1_1_NAMESPACE_URI);
                    writer.writeAttribute("message", targetNamespacePrefix + ":" + message.getMessageName());
//                  write extensibility attributes
View Full Code Here

        //WSDLService service = desc.getService(endpoints[i].getServiceName());
        //WSDLEndpoint endpoint = service.getEndpoint(new QName(service.getNamespace(), endpoints[i].getEndpointName()));
        Collection interfaces = desc.getWsdlInterfaces().values();
        for (Iterator iter = interfaces.iterator(); iter.hasNext();) {
          WSDLInterface itf = (WSDLInterface) iter.next();
          WSDLOperation op = itf.getOperation(operationName.getLocalPart());
          if (op != null) {
            meps.add(op.getMessageExchangePattern());
          }
        }
      } catch (Exception e) {
        // continue on
      }
View Full Code Here

        // let us configure the complete AxisService out of this, not the current the Operation only
        Iterator bindings = binding.getBindingOperations().values().iterator();

        while (bindings.hasNext()) {
            WSDLBindingOperation wsdlbop = (WSDLBindingOperation) bindings.next();
            WSDLOperation wsdlop = wsdlbop.getOperation();
            AxisOperation axisOp = AxisOperationFactory.getAxisOperation(findMEP(wsdlop));

            axisOp.setName(wsdlop.getName());
            serviceDesc.addOperation(axisOp);
        }

        // TODO: This part is compelte mess .. I think we need to look closly at the ServiceGroups  ..time been this works
        configurationContext.getAxisConfiguration().addService(serviceDesc);

        AxisServiceGroup serviceGroup =
                new AxisServiceGroup(configurationContext.getAxisConfiguration());
        ServiceGroupContext serviceGroupContext = new ServiceGroupContext(configurationContext,
                serviceGroup);
        ServiceContext serviceContext = new ServiceContext(serviceDesc, serviceGroupContext);
        WSDLOperation wsdlop = getOperation(operationname, endpoint);
        WSDLBindingOperation bop = binding.getBindingOperation(wsdlop.getName());
        Iterator elments = bop.getExtensibilityElements().iterator();

        while (elments.hasNext()) {
            Object obj = elments.next();

            if (obj instanceof SOAPOperation) {
                SOAPOperation soapOp = (SOAPOperation) obj;

                op.setSoapAction(soapOp.getSoapAction());

                break;
            }
        }

        MEPClient mepclient;

        if ((wsdlop.getInputMessage() != null) && (wsdlop.getOutputMessage() != null) && !isoneway) {
            mepclient = new InOutMEPClient(serviceContext);
        } else if ((wsdlop.getInputMessage() != null) || isoneway) {
            mepclient = new InOnlyMEPClient(serviceContext);
        } else {
            throw new AxisFault("Unknown MEP");
        }
View Full Code Here

    private WSDLOperation getOperation(String operation, WSDLEndpoint endpoint) throws AxisFault {
        WSDLInterface wsdlinterface = endpoint.getBinding().getBoundInterface();
        Iterator operations = wsdlinterface.getAllOperations().values().iterator();

        while (operations.hasNext()) {
            WSDLOperation wsdlOp = (WSDLOperation) operations.next();

            if (wsdlOp.getName().getLocalPart().equals(operation)) {
                return wsdlOp;
            }
        }

        throw new AxisFault("Operation Not found");
View Full Code Here

        addPolicyAsExtAttributes(description, policyList, wsdlInterface,
                policyInclude);

        Iterator wsdlOperations = wsdlInterface.getOperations().values()
                .iterator();
        WSDLOperation wsdlOperation;

        while (wsdlOperations.hasNext()) {
            wsdlOperation = (WSDLOperation) wsdlOperations.next();
            populatePolicy(description, wsdlOperation, axisService
                    .getOperation(wsdlOperation.getName()));

        }
    }
View Full Code Here

TOP

Related Classes of org.apache.wsdl.WSDLOperation

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.