Package org.apache.axis.wsdl.symbolTable

Examples of org.apache.axis.wsdl.symbolTable.Parameter


                            parms.returnParam.getMIMEType(), "_resp");
                }
                else {
                    // The resp object must go into a holder
                    int i = 0;
                    Parameter p = (Parameter) parms.list.get(i);

                    while (p.getMode() == Parameter.IN) {
                        p = (Parameter) parms.list.get(++i);
                    }
                    String javifiedName = Utils.xmlNameToJava(p.getName());
                    String qnameName = Utils.getNewQName(p.getQName());
                              
                    pw.println("            java.util.Map _output;");
                    pw.println("            _output = _call.getOutputParams();");
                    writeOutputAssign(pw, javifiedName + ".value = ",
                                      p.getType(), p.getMIMEType(),
                                      "_output.get(" + qnameName + ")");
                }
            }
            else {
                // There is more than 1 output.  Get the outputs from getOutputParams.   
                pw.println("            java.util.Map _output;");
                pw.println("            _output = _call.getOutputParams();");
                for (int i = 0; i < parms.list.size (); ++i) {
                    Parameter p = (Parameter) parms.list.get (i);
                    String javifiedName = Utils.xmlNameToJava(p.getName());
                    String qnameName = Utils.getNewQName(p.getQName());
                    if (p.getMode() != Parameter.IN) {
                        writeOutputAssign(pw, javifiedName + ".value = ",
                                          p.getType(), p.getMIMEType(),
                                          "_output.get(" + qnameName + ")");
                    }
                }
                if (parms.returnParam != null) {
                    writeOutputAssign(pw, "return ", parms.returnParam.getType(),
View Full Code Here


        String signature = "    public " + ret + " " + name + "(";

        boolean needComma = false;

        for (int i = 0; i < parms.list.size(); ++i) {
            Parameter p = (Parameter) parms.list.get(i);

            if (needComma) {
                signature = signature + ", ";
            }
            else {
                needComma = true;
            }

            String javifiedName = Utils.xmlNameToJava(p.getName());
            if (p.getMode() == Parameter.IN) {
                signature = signature + Utils.getParameterTypeName(p) + " " + javifiedName;
            }
            else {
                signature = signature + Utils.holder(p.getMIMEType(), p.getType(), emitter) + " "
                        + javifiedName;
            }
        }
        signature = signature + ") throws java.rmi.RemoteException";
        if (parms.faults != null) {
View Full Code Here

                    Iterator operations =
                            bEntry.getParameters().values().iterator();
                    while (operations.hasNext()) {
                        Parameters parms = (Parameters) operations.next();
                        for (int j = 0; j < parms.list.size(); ++j) {
                            Parameter p =
                                    (Parameter)parms.list.get(j);
                           
                            // If the given parameter is an inout or out parameter, then
                            // set a HOLDER_IS_NEEDED flag using the dynamicVar design.
                            if (p.getMode() != Parameter.IN) {
                                TypeEntry typeEntry = p.getType();
                                typeEntry.setDynamicVar(
                                        JavaTypeWriter.HOLDER_IS_NEEDED,
                                        new Boolean(true));
                                //If this is a complex then set the HOLDER_IS_NEEDED
                                //for the reftype too.
                                if(!typeEntry.isSimpleType() && typeEntry.getRefType()!=null){
                                    typeEntry.getRefType().setDynamicVar(
                                        JavaTypeWriter.HOLDER_IS_NEEDED,
                                        new Boolean(true));
                                }

                                // If the type is a DefinedElement, need to
                                // set HOLDER_IS_NEEDED on the anonymous type.
                                QName anonQName = SchemaUtils.
                                    getElementAnonQName(p.getType().getNode());
                                if (anonQName != null) {
                                    TypeEntry anonType =
                                        symbolTable.getType(anonQName);
                                    if (anonType != null) {
                                        anonType.setDynamicVar(
View Full Code Here

                                fault.getName(),
                                null, false);

        // Write data members of the exception and getter methods for them
        for (int i = 0; i < params.size(); i++) {
            Parameter param = (Parameter)params.get(i);
            String type = param.getType().getName();
            String variable = param.getName();
            pw.println("    public " + type + " " + variable + ";");
            pw.println("    public " + type + " get" + Utils.capitalizeFirstChar(variable) + "() {");
            pw.println("        return this." + variable + ";");
            pw.println("    }");
        }

        // Default contructor
        pw.println();
        pw.println("    public " + className + "() {");
        pw.println("    }");
        pw.println();
       
        // contructor that initializes data
        if (params.size() > 0) {
            pw.print("      public " + className + "(");
            for (int i = 0; i < params.size(); i++) {
                if (i != 0) pw.print(", ");
                Parameter param = (Parameter)params.get(i);
                String type = param.getType().getName();
                String variable = param.getName();
                pw.print(type + " " + variable);
            }
            pw.println(") {");
            for (int i = 0; i < params.size(); i++) {
                Parameter param = (Parameter)params.get(i);
                String variable = param.getName();
                pw.println("        this." + variable + " = " + variable + ";");
            }
            pw.println("    }");
        }
    } // writeFileBody
View Full Code Here

                    isFirst = false;
                } else {
                    pw.print(", ");
                }

                Parameter param = (Parameter) iparam.next();
                String paramType = param.getType().getName();
                String mimeType = param.getMIMEType();
                String suffix = "";

                // if we have an out or in/out, we are passing in a holder
                if (param.getMode() != Parameter.IN) {
                    pw.print("new " + Utils.holder(mimeType, param.getType(), emitter)
                            + "(");
                    suffix = ")";
                }

                // if we have an in or in/out, write the constructor
                if (param.getMode() != Parameter.OUT) {
                    String constructorString = Utils.getConstructorForParam(param, symbolTable, bThrow);
                    pw.print(constructorString);
                }
                pw.print(suffix);
            }
View Full Code Here

        pw.println(parms.signature + " {");

        // Fill in any out parameter holders
        Iterator iparam = parms.list.iterator();
        while (iparam.hasNext()) {
            Parameter param = (Parameter) iparam.next();
            if (param.getMode() == Parameter.OUT) {
                // write a constructor for each of the parameters
               
                BooleanHolder bThrow = new BooleanHolder(false);
                String constructorString =
                       Utils.getConstructorForParam(param, symbolTable, bThrow);
                if (bThrow.value) {
                    pw.println("        try {");
                }
                pw.println("        " + Utils.xmlNameToJava(param.getName())
                         + ".value = " + constructorString + ";");
                if (bThrow.value) {
                    pw.println("        } catch (Exception e) {");
                    pw.println("          // TBD - constructor may throw");
                    pw.println("        }");
View Full Code Here

                String opName = operation.getOperation().getName();
                String javaOpName = Utils.xmlNameToJava(opName);
                pw.println("        _params = new org.apache.axis.description.ParameterDesc [] {");

                for (int j=0; j < parameters.list.size(); j++) {
                    Parameter p = (Parameter) parameters.list.get(j);
                    String modeStr;
                    switch (p.getMode()) {
                        case Parameter.IN:
                            modeStr = "org.apache.axis.description.ParameterDesc.IN";
                            break;
                        case Parameter.OUT:
                            modeStr = "org.apache.axis.description.ParameterDesc.OUT";
                            break;
                        case Parameter.INOUT:
                            modeStr = "org.apache.axis.description.ParameterDesc.INOUT";
                            break;
                        default:
                            throw new IOException(
                                JavaUtils.getMessage("badParmMode00",
                                        (new Byte(p.getMode())).toString()));
                    }

                    // Get the QNames representing the parameter name and type
                    QName paramName = p.getQName();
                    QName paramType = Utils.getXSIType(p);
                    pw.println("            " +
                        "new org.apache.axis.description.ParameterDesc(" +
                        Utils.getNewQName(paramName) +
                        ", " + modeStr +
View Full Code Here

        for (int i = 0; i < parms.list.size(); ++i) {
            if (needComma)
                call = call + ", ";
            else
                needComma = true;
            Parameter p = (Parameter) parms.list.get(i);

            call = call + Utils.xmlNameToJava(p.getName());
        }
        call = call + ")";
        pw.println(call + ";");

        if (parms.returnParam != null) {
View Full Code Here

        }
        pw.println(" >");

        Vector paramList = params.list;
        for (int i = 0; i < paramList.size(); i++) {
            Parameter param = (Parameter) paramList.elementAt(i);

            // Get the parameter name QName and type QName
            QName paramQName = param.getQName();
            QName paramType = Utils.getXSIType(param);

            if (param.getMIMEType() != null) {
                paramType = Utils.getMIMETypeQName(param.getMIMEType());
            }

            pw.print("        <parameter");
            if (paramQName == null || "".equals(paramQName.getNamespaceURI())) {
                pw.print(" name=\"" + param.getName() + "\"" );
            } else {
                pw.print(" qname=\"" +
                         Utils.genQNameAttributeString(paramQName,
                                                       "pns") + "\"");
            }

            pw.print(" type=\"" +
                     Utils.genQNameAttributeString(paramType,
                                                   "tns") + "\"");
            // Get the parameter mode
            if (param.getMode() != Parameter.IN) {
                pw.print(" mode=\"" + getModeString(param.getMode()) + "\"");
            }
            pw.println("/>");
        }

        pw.println("      </operation>");
View Full Code Here

        Parameters params = bEntry.getParameters(operation);
       
        // Loop over parameter types for this operation
        for (int i=0; i < params.list.size(); i++) {
            Parameter p = (Parameter) params.list.get(i);
            v.add(p.getType());
        }
       
        // Add the return type
        if (params.returnParam != null)
            v.add(params.returnParam.getType());
View Full Code Here

TOP

Related Classes of org.apache.axis.wsdl.symbolTable.Parameter

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.