Package org.apache.wsdl

Examples of org.apache.wsdl.MessageReference


                wrappedInputName.getNamespaceURI(),
                wrappedInputName.getLocalPart()+ "Response",
                wrappedInputName.getPrefix());

        if (null != wsdl4jInputMessage) {
            MessageReference wsdlInputMessage = this.wsdlComponentFactory
                    .createMessageReference();
            wsdlInputMessage.setDirection(
                    WSDLConstants.WSDL_MESSAGE_DIRECTION_IN);
            wsdlInputMessage.setMessageLabel(
                    WSDLConstants.MESSAGE_LABEL_IN_VALUE);

            Message message = wsdl4jInputMessage.getMessage();
            if (null != message) {
                //wrapping has to be done on per message basis

                wsdlInputMessage.setElementQName(
                        this.generateReferenceQname(wrappedInputName
                                ,message,findWrapppable(message)));
                this.copyExtensibleElements(
                        (message).getExtensibilityElements(),
                        wsdlInputMessage, null);
            }
            this.copyExtensibilityAttribute(
                    wsdl4jInputMessage.getExtensionAttributes(),
                    wsdlInputMessage);
            wsdlOperation.setInputMessage(wsdlInputMessage);
        }

        //Create an output message and add
        Output wsdl4jOutputMessage = wsdl4jOperation.getOutput();
        if (null != wsdl4jOutputMessage) {
            MessageReference wsdlOutputMessage =
                    this.wsdlComponentFactory.createMessageReference();
            wsdlOutputMessage.setDirection(
                    WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);
            wsdlOutputMessage.setMessageLabel(
                    WSDLConstants.MESSAGE_LABEL_OUT_VALUE);

            Message outputMessage = wsdl4jOutputMessage.getMessage();
            if (null != outputMessage) {
                wsdlOutputMessage.setElementQName(
                        this.generateReferenceQname(wrappedOutputName,outputMessage,findWrapppable(outputMessage)));
                this.copyExtensibleElements(
                        (outputMessage).getExtensibilityElements(),
                        wsdlOutputMessage, null);
            }
View Full Code Here


            JMethod jmethod = method[i];
            //creating WSDLOperation
            WSDLOperation operation = womDescription.createOperation();
            operation.setName(new QName(jmethod.getSimpleName()));

            MessageReference messageRefinput = wsdlComponentFactory.createMessageReference();
            QName typeName = table.getComplexScheamType(jmethod.getSimpleName() +
                    SchemaGenerator.METHOD_REQUEST_WRAPPER);
            messageRefinput.setElementQName(typeName);
            messageRefinput.setDirection(org.apache.wsdl.WSDLConstants.WSDL_MESSAGE_DIRECTION_IN);
            operation.setInputMessage(messageRefinput);
            portType.setOperation(operation);

            if (!jmethod.getReturnType().isVoidType()) {
                MessageReference messageRefiout = wsdlComponentFactory.createMessageReference();
                messageRefiout.setElementQName(table.getQNamefortheType(jmethod.getSimpleName() +
                        SchemaGenerator.METHOD_RESPONSE_WRAPPER));
                messageRefiout.setDirection(org.apache.wsdl.WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);
                operation.setOutputMessage(messageRefiout);
            }
        }
        return portType;
    }
View Full Code Here

        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);
            binding.addBindingOperation(bindingoperation);

            SOAPOperationImpl soapOpimpl = new SOAPOperationImpl();
            soapOpimpl.setStyle(style);
            //to do heve to set a proper SOAPAction
            soapOpimpl.setSoapAction(opName);
            bindingoperation.addExtensibilityElement(soapOpimpl);
            if (inMessage != null) {
                WSDLBindingMessageReference bindingInMessage = wsdlComponentFactory.createWSDLBindingMessageReference();
                bindingInMessage.setDirection(org.apache.wsdl.WSDLConstants.WSDL_MESSAGE_DIRECTION_IN);
                bindingoperation.setInput(bindingInMessage);
                SOAPBodyImpl requestSoapbody = new SOAPBodyImpl();
                requestSoapbody.setUse(use);
                //todo need to fix this
                requestSoapbody.setNamespaceURI(namespeceURI);
                bindingInMessage.addExtensibilityElement(requestSoapbody);
            }

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

                bindingOutMessage.setDirection(org.apache.wsdl.WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);
                bindingoperation.setOutput(bindingOutMessage);
View Full Code Here

//                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
                    handleExtensibilityAttributes(outputMessage.getExtensibilityAttributes());
                    writer.writeEndElement();
                }

                //todo handle the faults here
View Full Code Here

            WSDLOperation operation;
            for (int i = 0; i < operations.length; i++) {
                operation = operations[i];
                // There's is no such concept as having multiple output parameters
                // (atleast in java) so our focus is only in the input message reference
                MessageReference inputMessage = operation.getInputMessage();
                processMessageReference(inputMessage);
            }
        }

View Full Code Here

            JMethod jmethod = method[i];
            //creating WSDLOperation
            WSDLOperation operation = womDescription.createOperation();
            operation.setName(new QName(jmethod.getSimpleName()));

            MessageReference messageRefinput = wsdlComponentFactory.createMessageReference();
            QName typeName = table.getComplexSchemaType(jmethod.getSimpleName() +
                    SchemaGenerator.METHOD_REQUEST_WRAPPER);
            messageRefinput.setElementQName(typeName);
            messageRefinput.setDirection(org.apache.wsdl.WSDLConstants.WSDL_MESSAGE_DIRECTION_IN);
            operation.setInputMessage(messageRefinput);
            portType.setOperation(operation);

            if (!jmethod.getReturnType().isVoidType()) {
                MessageReference messageRefiout = wsdlComponentFactory.createMessageReference();
                messageRefiout.setElementQName(table.getQNamefortheType(jmethod.getSimpleName() +
                        SchemaGenerator.METHOD_RESPONSE_WRAPPER));
                messageRefiout.setDirection(org.apache.wsdl.WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);
                operation.setOutputMessage(messageRefiout);
            }
        }
        return portType;
    }
View Full Code Here

        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);
            binding.addBindingOperation(bindingoperation);

            SOAPOperationImpl soapOpimpl = new SOAPOperationImpl();
            soapOpimpl.setStyle(style);
            //to do heve to set a proper SOAPAction
            soapOpimpl.setSoapAction(opName);
            bindingoperation.addExtensibilityElement(soapOpimpl);
            if (inMessage != null) {
                WSDLBindingMessageReference bindingInMessage = wsdlComponentFactory.createWSDLBindingMessageReference();
                bindingInMessage.setDirection(org.apache.wsdl.WSDLConstants.WSDL_MESSAGE_DIRECTION_IN);
                bindingoperation.setInput(bindingInMessage);
                SOAPBodyImpl requestSoapbody = new SOAPBodyImpl();
                requestSoapbody.setUse(use);
                //todo need to fix this
                requestSoapbody.setNamespaceURI(namespaceURI);
                bindingInMessage.addExtensibilityElement(requestSoapbody);
            }

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

                bindingOutMessage.setDirection(org.apache.wsdl.WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);
                bindingoperation.setOutput(bindingOutMessage);
View Full Code Here

            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();
View Full Code Here

        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

                wrappedInputName.getNamespaceURI(),
                wrappedInputName.getLocalPart()+ "Response",
                wrappedInputName.getPrefix());

        if (null != wsdl4jInputMessage) {
            MessageReference wsdlInputMessage = this.wsdlComponentFactory
                    .createMessageReference();
            wsdlInputMessage.setDirection(
                    WSDLConstants.WSDL_MESSAGE_DIRECTION_IN);
            wsdlInputMessage.setMessageLabel(
                    WSDLConstants.MESSAGE_LABEL_IN_VALUE);

            Message message = wsdl4jInputMessage.getMessage();
            if (null != message) {
                wsdlInputMessage.setElementQName(
                        this.generateReferenceQname(
                                wrappedInputName
                                ,message,
                                findWrapppable(message)));
                this.copyExtensibleElements(
                        (message).getExtensibilityElements(),
                        wsdlInputMessage, null);
            }

            this.copyExtensibilityAttribute(
                    wsdl4jInputMessage.getExtensionAttributes(),
                    wsdlInputMessage);
            wsdlOperation.setInputMessage(wsdlInputMessage);

            // attach the right schema element
            // Note  - commented till the XmlSchema baseuri code is fixed
            //findSchemaElement(wsdlInputMessage,wsdlTypes);
        }

        //Create an output message and add
        Output wsdl4jOutputMessage = wsdl4jOperation.getOutput();
        if (null != wsdl4jOutputMessage) {
            MessageReference wsdlOutputMessage =
                    this.wsdlComponentFactory.createMessageReference();
            wsdlOutputMessage.setDirection(
                    WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);
            wsdlOutputMessage.setMessageLabel(
                    WSDLConstants.MESSAGE_LABEL_OUT_VALUE);


            Message outputMessage = wsdl4jOutputMessage.getMessage();
            if (null != outputMessage) {
                wsdlOutputMessage.setElementQName(
                        this.generateReferenceQname(wrappedOutputName,outputMessage,findWrapppable(outputMessage)));
                this.copyExtensibleElements(
                        (outputMessage).getExtensibilityElements(),
                        wsdlOutputMessage, null);
            }
View Full Code Here

TOP

Related Classes of org.apache.wsdl.MessageReference

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.