Package javax.wsdl

Examples of javax.wsdl.Output


          Input in = portTypeOperation.getInput();
          if (in != null) {
                m = in.getMessage();
          }
        } else {
          Output out = portTypeOperation.getOutput();
          if (out != null) {
            m = out.getMessage();
          }
        }
        ArrayList al = getParts(m, soapbody.getParts());

    Trc.exit(al);
View Full Code Here


              Input in = portTypeOperation.getInput();
              if (in != null) {
                    m = in.getMessage();
              }
            } else {
              Output out = portTypeOperation.getOutput();
              if (out != null) {
                m = out.getMessage();
              }
            }
            ArrayList al = getParts(m, mimePartNames);
            if (isInput) {
              this.inputMIMEParts = al;
View Full Code Here

    return wsdlInputParts;
  }

  private ArrayList getWSDLOutputPartNames() {
    ArrayList wsdlOutputParts = new ArrayList();
    Output wsdlOutput = fieldOperation.getOutput();
    if (wsdlOutput != null) {
      Message outputMessage = wsdlOutput.getMessage();
      String partName;
      for (Iterator i = outputMessage.getParts().keySet().iterator();
        i.hasNext();
        ) {
        partName = (String) i.next();
View Full Code Here

        Operation operation = findMatchingOperation(method, args);

        // Now set up the input and output messages.     
        Input input = operation.getInput();
        Output output = operation.getOutput();
        String inputName = (input == null) ? null : input.getName();
        String outputName = (output == null) ? null : output.getName();
        Message inputMessage = (input == null) ? null : input.getMessage();
        Message outputMessage = (output == null) ? null : output.getMessage();

        WSIFOperation wsifOperation =
            wsifport.createOperation(method.getName(), inputName, outputName);

        // make the msg names for compiled msgs xxxAnt ask Mark why diff from inputName
        String inputMsgName = "";
        if (input != null) {
            Message m = input.getMessage();
            if (m != null) {
                QName qn = m.getQName();
                inputMsgName = (qn == null) ? "" : qn.getLocalPart();
            }
        }

        String outputMsgName = "";
        if (output != null) {
            Message m = output.getMessage();
            if (m != null) {
                QName qn = m.getQName();
                outputMsgName = (qn == null) ? "" : qn.getLocalPart();
            }
        }
View Full Code Here

        for (Iterator i = operationList.iterator(); i.hasNext();) {
            Operation op = (Operation) i.next();
            String name = op.getName();
            //System.err.println("op = "+op);
            Input input = op.getInput();
            Output output = op.getOutput();
            if (input == null) {
                throw new WSIFException("missing input message for operation " + name);

            }
            if (output == null) {
                throw new WSIFException("missing output message for operation " + name);
            }

            WSIFOperation_SoapRMI opInst = new WSIFOperation_SoapRMI(this, op, typeMap);

            BindingOperation bop =
                binding.getBindingOperation(name, input.getName(), output.getName());

            if (bop == null) {
                throw new WSIFException(
                    "mising required in WSDL 1.1 binding operation for " + name);
            }
View Full Code Here

            if (opType == null) {
                throw new WSIFException("operation " + name + " has no type!");
            }
            if (opType.equals(OperationType.REQUEST_RESPONSE)) {
                Input input = op.getInput();
                Output output = op.getOutput();
                if (input == null) {
                    throw new WSIFException("missing input message for operation " + name);
                }
                if (output == null) {
                    throw new WSIFException("missing output message for operation " + name);
View Full Code Here

            names = new String[0];
            types = new Class[0];
        }

        // now prepare return value
        Output output = operation.getOutput();
        if (output != null) {
            Part returnPart = null;
            if (returnName != null) {
                returnPart = output.getMessage().getPart(returnName);
                if (returnPart == null) {
                    throw new WSIFException(
                        "no output part named " + returnName + " for bining operation " + getName());
                }
            } else {
                List parts = output.getMessage().getOrderedParts(null);
                if (parts.size() > 0) {
                    returnPart = (Part) parts.get(0);
                    returnName = returnPart.getName();
                }
            }
View Full Code Here

            names = new String[0];
            types = new Class[0];
        }

        // now prepare return value
        Output output = operation.getOutput();
        if (output != null) {
            Part returnPart = null;
            if (returnName != null) {
                returnPart = output.getMessage().getPart(returnName);
                if (returnPart == null) {
                    throw new WSIFException(
                        "no output part named "
                            + returnName
                            + " for bining operation "
                            + getName());
                }
            } else {
                List parts = output.getMessage().getOrderedParts(null);
                if (parts.size() > 0) {
                    returnPart = (Part) parts.get(0);
                    returnName = returnPart.getName();
                }
            }

            if (returnPart != null) {
                QName partType = returnPart.getTypeName();
                if (partType == null)
                    partType = returnPart.getElementName();

                org.apache.soap.util.xml.QName qname =
                    new org.apache.soap.util.xml.QName(
                        partType.getNamespaceURI(),
                        partType.getLocalPart());

                try {
                    returnType = (Class) mapOfUserTypes.get(qname);
                } catch (Throwable ignored) {
                    Trc.ignoredException(ignored);
                }

                if (returnType == null) {
                    try {
                        returnType =
                            (Class) smr.queryJavaType(
                                qname,
                                outputEncodingStyle);
                    } catch (Throwable exn) {
                        if (returnType == null) {
                            try {
                                String packageName =
                                    WSIFUtils.getPackageNameFromNamespaceURI(
                                        qname.getNamespaceURI());
                                String className =
                                    WSIFUtils.getJavaClassNameFromXMLName(
                                        qname.getLocalPart());
                                try {
                                    returnType =
                                        Class.forName(
                                            packageName + "." + className,
                                            true,
                                            Thread
                                                .currentThread()
                                                .getContextClassLoader());
                                } catch (ClassNotFoundException exn5) {
                                    returnType =
                                        Class.forName(
                                            packageName
                                                + "."
                                                + className
                                                + "Element",
                                            true,
                                            Thread
                                                .currentThread()
                                                .getContextClassLoader());
                                }
                                if ("literal".equals(outputUse)) {
                                    smr.mapTypes(
                                        "literal",
                                        qname,
                                        returnType,
                                        partSer,
                                        partSer);
                                } else {
                                    smr.mapTypes(
                                        Constants.NS_URI_SOAP_ENC,
                                        qname,
                                        returnType,
                                        beanSer,
                                        beanSer);
                                }
                                mapSubtypes(returnType, beanSer, partSer, smr, outputUse);
                            } catch (ClassNotFoundException exn1) {
                                Trc.ignoredException(exn1);
                            }
                        }
                    }

                }
            }
            // setup any output paramter part names defined in the WSDL
            List parts = output.getMessage().getOrderedParts(null);
            if (parts.size() > 1) {
                ArrayList al = new ArrayList();
                for (int i = 1; i < parts.size(); i++) {
                    al.add(((Part) parts.get(i)).getName());
                }
View Full Code Here

                            + "'operationName:inputMessageName:outputMesssageName' to distinguish it");
                }
                found = true;
                Input opInput = op.getInput();
                inputName = (opInput.getName() == null) ? null : opInput.getName();
                Output opOutput = op.getOutput();
                outputName = (opOutput.getName() == null) ? null : opOutput.getName();
            }
        }

        WSIFOperation operation =
            port.createOperation(operationName, inputName, outputName);
        WSIFMessage input = operation.createInputMessage();
        WSIFMessage output = operation.createOutputMessage();
        WSIFMessage fault = operation.createFaultMessage();

        // retrieve list of names and types for input and names for output
        List operationList = portType.getOperations();

        // find portType operation to prepare in/oout message w/ parts
        boolean found = false;
        String[] outNames = new String[0];
        Class[] outTypes = new Class[0];
        for (Iterator i = operationList.iterator(); i.hasNext();) {
            Operation op = (Operation) i.next();
            String name = op.getName();
            if (!name.equals(operationName)) {
                continue;
            }
            if (found) {
                throw new RuntimeException("overloaded operations are not supported in this sample");
            }
            found = true;

            //System.err.println("op = "+op);
            Input opInput = op.getInput();

            // first determine list of arguments
            String[] inNames = new String[0];
            Class[] inTypes = new Class[0];
            if (opInput != null) {
                List parts = opInput.getMessage().getOrderedParts(null);
                unWrapIfWrappedDocLit(parts, name, def);
                int count = parts.size();
                inNames = new String[count];
                inTypes = new Class[count];
                retrieveSignature(parts, inNames, inTypes);
            }
            // now prepare out parameters

            for (int pos = 0; pos < inNames.length; ++pos) {
                String arg = args[pos + argShift];
                Object value = null;
                Class c = inTypes[pos];
                if (c.equals(String.class)) {
                    value = arg;
                } else if (c.equals(Double.TYPE)) {
                    value = new Double(arg);
                } else if (c.equals(Float.TYPE)) {
                    value = new Float(arg);
                } else if (c.equals(Integer.TYPE)) {
                    value = new Integer(arg);
                } else if (c.equals(Boolean.TYPE)) {
                    value = new Boolean(arg);
                } else {
                    throw new RuntimeException("not know how to convert '" + arg + "' into " + c);
                }

                input.setObjectPart(inNames[pos], value);
            }

            Output opOutput = op.getOutput();
            if (opOutput != null) {
                List parts = opOutput.getMessage().getOrderedParts(null);
                unWrapIfWrappedDocLit(parts, name+"Response", def);
                int count = parts.size();
                outNames = new String[count];
                outTypes = new Class[count];
                retrieveSignature(parts, outNames, outTypes);
View Full Code Here

            if (opType == null) {
                throw new WSIFException("operation " + name + " has no type!");
            }
            if (opType.equals(OperationType.REQUEST_RESPONSE)) {
                Input input = op.getInput();
                Output output = op.getOutput();
                if (input == null) {
                    throw new WSIFException("missing input message for operation " + name);
                }
                if (output == null) {
                    throw new WSIFException("missing output message for operation " + name);
View Full Code Here

TOP

Related Classes of javax.wsdl.Output

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.