Package org.apache.wsdl

Examples of org.apache.wsdl.WSDLInterface


        namespaceMap.put("xs", Constants.URI_2001_SCHEMA_XSD);
        womDescription.setNamespaces(namespaceMap);
        womDescription.setTargetNameSpace(targetNamespece);

        // generating port type
        WSDLInterface portType = generatePortType(womDescription,
                wsdlComponentFactory, documentElement);
        womDescription.addInterface(portType);

        QName bindingName = new QName(targetNamespece, axisService.getName()
                + "Binding", targetNamespecheprefix);
View Full Code Here


                .getExtensionElement(ExtensionConstants.SCHEMA);
        wsdlTypes.addExtensibilityElement(schemaExtensibilityElement);
        schemaExtensibilityElement.setElement(documentElement);
        womDescription.setTypes(wsdlTypes);

        WSDLInterface portType = womDescription.createInterface();
        portType.setName(new QName(axisService.getName() + "Port"));

        ArrayList policyElements;
        PolicyInclude include;

        include = axisService.getPolicyInclude();

        // adding policies defined in wsdl:portType
        policyElements = include.getPolicyElements(PolicyInclude.PORT_TYPE_POLICY);
        addPolicyAsExtAttributes(womDescription, policyElements, portType, include);

        Iterator operations = axisService.getOperations();
        while (operations.hasNext()) {
            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
            }
            portType.setOperation(wsdlOperation);

        }
        return portType;
    }
View Full Code Here

        //copy the Interfaces: Get the PortTypes from WSDL4J parse OM and
        // copy it to the  WOM's WSDLInterface Components

        Iterator portTypeIterator = wsdl4JDefinition.getPortTypes().values()
                .iterator();
        WSDLInterface wsdlInterface;
        PortType portType;
        while (portTypeIterator.hasNext()) {
            wsdlInterface = this.wsdlComponentFactory.createInterface();
            portType = (PortType) portTypeIterator.next();
            this.populateInterfaces(wsdlInterface, portType,womDefinition);
View Full Code Here

                                  Binding wsdl4JBinding, Definition wsdl4jDefinition) {

        //Copy attributes
        wsdlBinding.setName(wsdl4JBinding.getQName());
        QName interfaceName = wsdl4JBinding.getPortType().getQName();
        WSDLInterface wsdlInterface =
                this.womDefinition.getInterface(interfaceName);

        //FIXME Do We need this eventually???
        if (null == wsdlInterface)
            throw new WSDLProcessingException("Interface/PortType not found for the Binding :"
                    + wsdlBinding.getName());
        wsdlBinding.setBoundInterface(wsdlInterface);
        Iterator bindingoperationsIterator =
                wsdl4JBinding.getBindingOperations().iterator();
        WSDLBindingOperation wsdlBindingOperation;
        BindingOperation wsdl4jBindingOperation;
        while (bindingoperationsIterator.hasNext()) {
            wsdlBindingOperation =
                    this.wsdlComponentFactory.createWSDLBindingOperation();
            wsdl4jBindingOperation =
                    (BindingOperation) bindingoperationsIterator.next();

            //for the namespace we should pick the namespace from the porttype
            //not the binding since the portyype can be imported and then the
            //namespaces of the binding and porttype can differ

            PortType portType = wsdl4JBinding.getPortType();
            String namespaceURI = "";
            if (portType!=null){
                namespaceURI = portType.getQName().getNamespaceURI();
            }else{
                namespaceURI = wsdl4JBinding.getQName().getNamespaceURI();
            }

            this.populateBindingOperation(wsdlBindingOperation,
                    wsdl4jBindingOperation,
                    namespaceURI,
                    wsdl4jDefinition);
            wsdlBindingOperation.setOperation(
                    wsdlInterface.getOperation(
                            wsdl4jBindingOperation.getOperation().getName()));
            copyExtensibleElements(
                    wsdl4jBindingOperation.getExtensibilityElements(),
                    wsdlBindingOperation, wsdl4jDefinition);
            wsdlBinding.addBindingOperation(wsdlBindingOperation);
View Full Code Here

//If there are more than one interface available... For the time being
// create a
// new interface and set all those existing interfaces as
// superinterfaces of it
// and return.
        WSDLInterface newBoundInterface = this.womDefinition.createInterface();
        newBoundInterface.setName(
                new QName(service.getNamespace(),
                        service
                                .getName()
                                .getLocalPart()
                                + BOUND_INTERFACE_NAME));
        Iterator interfaceIterator = this.womDefinition.getWsdlInterfaces()
                .values().iterator();
        while (interfaceIterator.hasNext()) {
            newBoundInterface
                    .addSuperInterface(
                            (WSDLInterface) interfaceIterator.next());
        }
        return newBoundInterface;
    }
View Full Code Here

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

        if (mBag == null || mBag.isEmpty()) {
            //No metadata! So do some guess work!
            Map interfaceMap = desc.getWsdlInterfaces();
            if (!interfaceMap.isEmpty()) {
                Iterator interfaceIterator = interfaceMap.values().iterator();
                WSDLInterface wsdlInterface;
                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();
View Full Code Here

     */
    protected void writePortTypes(WSDLDescription desc) throws XMLStreamException, IOException {
        Map interfaceMap = desc.getWsdlInterfaces();
        if (!interfaceMap.isEmpty()) {
            Iterator interfaceIterator = interfaceMap.values().iterator();
            WSDLInterface wsdlInterface;
            while (interfaceIterator.hasNext()) {
                wsdlInterface = (WSDLInterface) interfaceIterator.next();
                writer.writeStartElement(defaultWSDLPrefix, PORTTYPE_NAME, WSDL1_1_NAMESPACE_URI);
                writer.writeAttribute("name",
                        wsdlInterface.getName() == null ? "" : wsdlInterface.getName().getLocalPart());
                //write extensibility attributes
                handleExtensibilityAttributes(wsdlInterface.getExtensibilityAttributes());
                //write the operations
                writePorttypeOperations(wsdlInterface);

                writer.writeEndElement();

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

    public WSDLDescription getDescription() {
        return description;
    }

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

TOP

Related Classes of org.apache.wsdl.WSDLInterface

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.