Package javax.wsdl

Examples of javax.wsdl.Part


        operation.setUndefined(false);
        return operation;
    }

    public Part generatePart(Definition definition, DataType arg, String partName) {
        Part part = definition.createPart();
        part.setName(partName);
        if (arg != null && arg.getLogical() instanceof XMLType) {
            XMLType xmlType = (XMLType)arg.getLogical();
            QName elementName = xmlType.getElementName();
            part.setElementName(elementName);
            addNamespace(definition, elementName);
            if (xmlType.getElementName() == null) {
                QName typeName = xmlType.getTypeName();
                part.setTypeName(typeName);
                addNamespace(definition, typeName);
            }
        }
        return part;
    }
View Full Code Here


    public Part generateWrapperPart(Definition definition,
                                    Operation operation,
                                    Map<String, XMLTypeHelper> helpers,
                                    Map<QName, List<ElementInfo>> wrappers,
                                    boolean input) throws WSDLException {
        Part part = definition.createPart();
        String partName = input ? operation.getName() : (operation.getName() + "Response");
        part.setName(partName);
        WrapperInfo opWrapper = operation.getWrapper();
        if (opWrapper != null) {
            ElementInfo elementInfo =
                input ? opWrapper.getInputWrapperElement() : opWrapper.getOutputWrapperElement();
            List<ElementInfo> elements =
                input ? opWrapper.getInputChildElements() : opWrapper.getOutputChildElements();
            QName wrapperName = elementInfo.getQName();
            part.setElementName(wrapperName);
            addNamespace(definition, wrapperName);
            wrappers.put(wrapperName, elements);

            // FIXME: [rfeng] Ideally, we should try to register the wrappers only. But we are
            // expriencing the problem that we cannot handle XSD imports
View Full Code Here

            inputName = wsdlOperation.getName();
        }
        input.setMessageName(inputName);
       
        for (Iterator itPart = wsdlInput.getMessage().getOrderedParts(null).iterator(); itPart.hasNext();) {
            Part wsdlPart = (Part) itPart.next();
            Wsdl1SoapPartImpl part = new Wsdl1SoapPartImpl();
            part.setName(wsdlPart.getName());
            part.setType(wsdlPart.getTypeName());
            part.setElement(wsdlPart.getElementName());
            if ((wsdlSoapBody.getParts() == null && wsdlInput.getMessage().getOrderedParts(null).size() == 1) ||
                    wsdlSoapBody.getParts().contains(part.getName())) {
                part.setBody(true);
                input.setElementName(wsdlPart.getElementName());
            } else {
                boolean header = false;
                for (SOAP12Header h : wsdlSoapHeaders) {
                    if (wsdlPart.getName().equals(h.getPart())) {
                        header = true;
                    }
                }
                if (header) {
                    part.setHeader(true);
View Full Code Here

            outputName = wsdlOperation.getName() + "Response";
        }
        output.setMessageName(outputName);
       
        for (Iterator itPart = wsdlOutput.getMessage().getOrderedParts(null).iterator(); itPart.hasNext();) {
            Part wsdlPart = (Part) itPart.next();
            Wsdl1SoapPartImpl part = new Wsdl1SoapPartImpl();
            part.setName(wsdlPart.getName());
            part.setType(wsdlPart.getTypeName());
            part.setElement(wsdlPart.getElementName());
            if ((wsdlSoapBody.getParts() == null && wsdlOutput.getMessage().getOrderedParts(null).size() == 1) ||
                    wsdlSoapBody.getParts().contains(part.getName())) {
                part.setBody(true);
                output.setElementName(wsdlPart.getElementName());
            } else {
                boolean header = false;
                for (SOAP12Header h : wsdlSoapHeaders) {
                    if (wsdlPart.getName().equals(h.getPart())) {
                        header = true;
                    }
                }
                if (header) {
                    part.setHeader(true);
View Full Code Here

   
    public void checkMessages() {
        for (Iterator itMsg = definition.getMessages().values().iterator(); itMsg.hasNext();) {
            Message msg = (Message) itMsg.next();
            for (Iterator it2 = msg.getParts().values().iterator(); it2.hasNext();) {
                Part p = (Part) it2.next();
                if (p.getTypeName() != null && p.getElementName() != null) {
                    error(Code.R2306, msg);
                }
            }
        }
    }
View Full Code Here

                    String partName = BPEComponent.PART_PAYLOAD;
                    QName elemName = new QName(e.getNamespaceURI(), e.getLocalName());
                    if (wsdlOperation != null) {
                        for (Iterator itFault = wsdlOperation.getFaults().values().iterator(); itFault.hasNext();) {
                            Fault f = (Fault) itFault.next();
                            Part p = (Part) f.getMessage().getParts().values().iterator().next();
                            if (elemName.equals(p.getTypeName())) {
                                faultName = f.getName();
                                partName = p.getName();
                            }
                        }
                    }
                    BPRuntimeException bpre = new BPRuntimeException(faultName, "");
                    bpre.setNameSpace(e.getNamespaceURI());
View Full Code Here

            inputName = wsdlOperation.getName();
        }
        input.setMessageName(inputName);
       
        for (Iterator itPart = wsdlInput.getMessage().getOrderedParts(null).iterator(); itPart.hasNext();) {
            Part wsdlPart = (Part) itPart.next();
            Wsdl1SoapPartImpl part = new Wsdl1SoapPartImpl();
            part.setName(wsdlPart.getName());
            part.setType(wsdlPart.getTypeName());
            part.setElement(wsdlPart.getElementName());
            if ((wsdlSoapBody.getParts() == null && wsdlInput.getMessage().getOrderedParts(null).size() == 1) ||
                    wsdlSoapBody.getParts().contains(part.getName())) {
                part.setBody(true);
                if (operation.getStyle() == Style.DOCUMENT) {
                    input.setElementName(wsdlPart.getElementName());
                }
            } else {
                boolean header = false;
                for (SOAPHeader h : wsdlSoapHeaders) {
                    if (wsdlPart.getName().equals(h.getPart())) {
                        header = true;
                    }
                }
                if (header) {
                    part.setHeader(true);
View Full Code Here

            outputName = wsdlOperation.getName() + "Response";
        }
        output.setMessageName(outputName);
       
        for (Iterator itPart = wsdlOutput.getMessage().getOrderedParts(null).iterator(); itPart.hasNext();) {
            Part wsdlPart = (Part) itPart.next();
            Wsdl1SoapPartImpl part = new Wsdl1SoapPartImpl();
            part.setName(wsdlPart.getName());
            part.setType(wsdlPart.getTypeName());
            part.setElement(wsdlPart.getElementName());
            if ((wsdlSoapBody.getParts() == null && wsdlOutput.getMessage().getOrderedParts(null).size() == 1) ||
                    wsdlSoapBody.getParts().contains(part.getName())) {
                part.setBody(true);
                output.setElementName(wsdlPart.getElementName());
            } else {
                boolean header = false;
                for (SOAPHeader h : wsdlSoapHeaders) {
                    if (wsdlPart.getName().equals(h.getPart())) {
                        header = true;
                    }
                }
                if (header) {
                    part.setHeader(true);
View Full Code Here

        def.addNamespace("xsd", "http://www.w3.org/2000/10/XMLSchema");
        def.addNamespace("w", "uri:hello");
        Message inMsg = def.createMessage();
        inMsg.setQName(new QName("http://porttype.test", "InMessage"));
        inMsg.setUndefined(false);
        Part part1 = def.createPart();
        part1.setName("part1");
        if (rpc) {
            part1.setTypeName(new QName("http://www.w3.org/2000/10/XMLSchema", "int"));
        } else {
            part1.setElementName(new QName("uri:hello", "world"));
        }
        inMsg.addPart(part1);
        Part part2 = def.createPart();
        part2.setName("part2");
        part2.setElementName(new QName("uri:hello", "world"));
        inMsg.addPart(part2);
        def.addMessage(inMsg);
        Message outMsg = def.createMessage();
        outMsg.setQName(new QName("http://porttype.test", "OutMessage"));
        outMsg.setUndefined(false);
        Part part3 = def.createPart();
        part3.setName("part3");
        part3.setElementName(new QName("uri:hello", "world"));
        outMsg.addPart(part3);
        def.addMessage(outMsg);
        PortType type = def.createPortType();
        type.setUndefined(false);
        type.setQName(new QName("http://porttype.test", "MyConsumerInterface"));
View Full Code Here

                    Element complexType =
                        document.createElementNS("http://www.w3.org/2001/XMLSchema", xsPrefix + ":complexType");
                    wrapper.appendChild(complexType);

                    // create new part for the wrapper and add it to the message
                    Part part = definition.createPart();
                    part.setName("parameters");
                    part.setElementName(new QName(namespaceURI, opName, prefix));
                    inputMsg.addPart(part);
                }
            }

            // if two-way operation has no output message, add one containing an empty wrapper
            if (input != null && operation.getOutput() == null) {
                boolean isOneWay = false;
                Method[] methods = javaInterface.getMethods();
                for (Method method : methods) {
                    if (method.getName().equals(opName) && method.getAnnotation(OneWay.class) != null) {
                        isOneWay = true;
                    }
                }
                if (!isOneWay) {
                    // create wrapper element and add it to the schema DOM
                    String msgName = opName + "Response";
                    Element wrapper =
                        document.createElementNS("http://www.w3.org/2001/XMLSchema", xsPrefix + ":element");
                    wrapper.setAttribute("name", msgName);
                    schema.appendChild(wrapper);
                    Element complexType =
                        document.createElementNS("http://www.w3.org/2001/XMLSchema", xsPrefix + ":complexType");
                    wrapper.appendChild(complexType);

                    // create new part for the wrapper
                    Part part = definition.createPart();
                    part.setName("parameters");
                    part.setElementName(new QName(namespaceURI, msgName, prefix));

                    // create new message for the part
                    Message outputMsg = definition.createMessage();
                    outputMsg.setQName(new QName(namespaceURI, msgName, prefix));
                    outputMsg.addPart(part);
View Full Code Here

TOP

Related Classes of javax.wsdl.Part

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.