Package javax.wsdl

Examples of javax.wsdl.Message


    private BindingOperation buildBindingOperation(Definition definition, ExtensionRegistry extensionRegistry) throws WSDLException {
        Operation operation = definition.createOperation();
        operation.setName(operationName);
        operation.setStyle(OperationType.REQUEST_RESPONSE);
        Input input = definition.createInput();
        Message inputMessage = definition.createMessage();
        Part inputPart = definition.createPart();
        inputPart.setName("string");
        inputPart.setTypeName(new QName("http://www.w3.org/2001/XMLSchema", "string"));
        inputMessage.addPart(inputPart);
        operation.setInput(input);
        input.setMessage(inputMessage);
        Output output = definition.createOutput();
        Message outputMessage = definition.createMessage();
        operation.setOutput(output);
        output.setMessage(outputMessage);
        BindingOperation bindingOperation = definition.createBindingOperation();
        SOAPOperation soapOperation = (SOAPOperation) extensionRegistry.createExtension(BindingOperation.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "operation"));
        soapOperation.setSoapActionURI("actionURI");
View Full Code Here


        qnameToClassMap.put(new QName("http://www.w3.org/2001/XMLSchema", "anySimpleType"), String.class);
    }


    private FaultDesc mapException(String faultName, Fault fault) throws DeploymentException {
        Message message = fault.getMessage();
        QName messageQName = message.getQName();
        ExceptionMappingType exceptionMapping = (ExceptionMappingType) exceptionMap.get(messageQName);
        if (exceptionMapping == null) {
            throw new DeploymentException("No exception mapping for fault " + faultName + " and fault message " + messageQName + " for operation " + operationName);
        }
        String className = exceptionMapping.getExceptionType().getStringValue().trim();
        //TODO investigate whether there are other cases in which the namespace of faultQName can be determined.
        //this is weird, but I can't figure out what it should be.
        //if part has an element rather than a type, it should be part.getElementName() (see below)
        QName faultQName = new QName("", faultName);
        Part part;
        if (exceptionMapping.isSetWsdlMessagePartName()) {
            //According to schema documentation, this will only be set when several headerfaults use the same message.
            String headerFaultMessagePartName = exceptionMapping.getWsdlMessagePartName().getStringValue();
            part = message.getPart(headerFaultMessagePartName);
        } else {
            part = (Part) message.getOrderedParts(null).iterator().next();
        }
        QName faultTypeQName;// = part.getElementName() == null ? part.getTypeName() : part.getElementName();
        if (part.getElementName() == null) {
            faultTypeQName = part.getTypeName();
            if (faultTypeQName == null) {
View Full Code Here

    public boolean isDocLitWrapped() {
        boolean flag = getStyle().equals("document") && getUse().equals("literal");
        if (!flag) {
            return false;
        }
        Message msg = getMessage(true);
        if (msg == null) {
            return false;
        }
        List parts = msg.getOrderedParts(null);
        if (parts.size() != 1) {
            return false;
        }
        Part part = (Part) parts.get(0);
        QName element = part.getElementName();
View Full Code Here

        }
    }

    public Part getInputPart(int index) {
        Part part = null;
        Message message = getMessage(true);
        if (message == null) {
            return part;
        }

        List parts = message.getOrderedParts(null);
        return (Part) parts.get(index);

    }
View Full Code Here

    }

    public Part getOutputPart(int index) {
        Part part = null;
        Message message = getMessage(false);
        if (message == null) {
            return part;
        }

        List parts = message.getOrderedParts(null);
        return (Part) parts.get(index);

    }
View Full Code Here

     * @return
     */
    public List<Integer> getBodyPartIndexes(boolean isInput) {
        List<Integer> indexes = new ArrayList<Integer>();

        Message message = getMessage(isInput);
        if (message == null) {
            return indexes;
        }

        List<String> bodyParts = getSOAPBodyParts(isInput);
        List parts = message.getOrderedParts(null);
        Set headerParts = isInput ? getInputHeaderParts() : getOutputHeaderParts();

        int index = 0;
        for (Iterator i = parts.iterator(); i.hasNext(); index++) {
            Part part = (Part) i.next();
View Full Code Here

     *            TODO
     * @return
     */
    public int getHeaderPartIndex(QName elementName, boolean isInput) {

        Message message = getMessage(isInput);
        if (message == null) {
            return -1;
        }

        List parts = message.getOrderedParts(null);
        Set headerParts = isInput ? getInputHeaderParts() : getOutputHeaderParts();

        int index = 0;
        for (Iterator i = parts.iterator(); i.hasNext(); index++) {
            Part part = (Part) i.next();
View Full Code Here

                PortType pt = ((WSDLServiceContract) sc).getPortType();
                for (Object o : pt.getOperations()) {
                    Operation operation = (Operation) o;
                    Input input = operation.getInput();
                    if (input != null) {
                        Message message = input.getMessage();
                        if (message != null) {
                            List parts = message.getOrderedParts(null);
                            if (parts != null && parts.size() > 0) {
                                Part part = (Part) parts.get(0);
                                dataBinding.addElementQName(operation.getName(), part.getElementName());
                            }
                        }
View Full Code Here

            for (Iterator ite2 = binding.getPortType().getOperations().iterator(); ite2.hasNext();) {
                Operation operation = (Operation)ite2.next();
                BindingOperation bop = wsdlHelper.getBindingOperation(def, operation.getName());
                if (operation.getInput() != null && operation.getInput().getMessage() != null) {
                    Message inMess = operation.getInput().getMessage();

                    for (Iterator ite3 = inMess.getParts().values().iterator(); ite3.hasNext();) {
                        Part p = (Part)ite3.next();
                        if (SOAPBinding.Style.RPC.name().equalsIgnoreCase(style) && p.getTypeName() == null
                            && !isHeaderPart(bop, p)) {
                            addErrorMessage("An rpc-literal binding in a DESCRIPTION MUST refer, "
                                            + "in its soapbind:body element(s), only to "
                                            + "wsdl:part element(s) that have been defined "
                                            + "using the type attribute.");
                            return false;
                        }

                        if (SOAPBinding.Style.DOCUMENT.name().equalsIgnoreCase(style)
                            && p.getElementName() == null) {
                            addErrorMessage("A document-literal binding in a DESCRIPTION MUST refer, "
                                            + "in each of its soapbind:body element(s),"
                                            + "only to wsdl:part element(s)"
                                            + " that have been defined using the element attribute.");
                            return false;
                        }

                    }
                }
                if (operation.getOutput() != null && operation.getOutput().getMessage() != null) {
                    Message outMess = operation.getOutput().getMessage();
                    for (Iterator ite3 = outMess.getParts().values().iterator(); ite3.hasNext();) {
                        Part p = (Part)ite3.next();
                        if (style.equalsIgnoreCase(SOAPBinding.Style.RPC.name()) && p.getTypeName() == null
                            &&  !isHeaderPart(bop, p)) {
                            addErrorMessage("An rpc-literal binding in a DESCRIPTION MUST refer, "
                                            + "in its soapbind:body element(s), only to "
View Full Code Here

                if (CollectionUtils.isEmpty(faults)) {
                    continue;
                }

                for (Fault fault : faults) {
                    Message message = fault.getMessage();
                    Collection<Part> parts = message.getParts().values();
                    for (Part part : parts) {
                        if (part.getElementName() == null) {
                            addErrorMessage(getErrorPrefix("WSI-BP-1.0 R2205") + "In Message "
                                + message.getQName() + ", part " + part.getName()
                                    + " must specify a 'element' attribute");
                            return false;
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of javax.wsdl.Message

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.