Package org.apache.axis.wsdl.symbolTable

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


     * Logic to set the generators that are based on the Binding
     * This logic was moved from the constructor so extended interfaces
     * can more effectively use the hooks.
     */
    protected void setGenerators() {
        BindingEntry bEntry = symbolTable.getBindingEntry(binding.getQName());
       
        // Interface writer
        PortTypeEntry ptEntry =
            symbolTable.getPortTypeEntry(binding.getPortType().getQName());
        if (ptEntry.isReferenced()) {
            interfaceWriter = getJavaInterfaceWriter(
                                 emitter, ptEntry, bEntry, symbolTable);
        }
       
        if (bEntry.isReferenced()) {
            // Stub writer
            stubWriter = getJavaStubWriter(emitter, bEntry, symbolTable);

            // Skeleton and Impl writers
            if (emitter.isServerSide()) {
                if (emitter.isSkeletonWanted()) {
                    skelWriter = getJavaSkelWriter(emitter, bEntry, symbolTable);
                }
                String fileName = Utils.getJavaLocalName(bEntry.getName())
                        + "Impl.java";
                try {
                    if (Utils.fileExists(fileName,
                            binding.getQName().getNamespaceURI(),
                            emitter.getNamespaces())) {
View Full Code Here


        // Traverse the bindings to find faults
        Map bindings = def.getBindings();
        Iterator bindi = bindings.values().iterator();
        while (bindi.hasNext()) {
            Binding binding = (Binding) bindi.next();
            BindingEntry entry = symbolTable.getBindingEntry(binding.getQName());
            if (entry.isReferenced()) {
                // use the map of bindingOperation -> fault info
                // created in SymbolTable
                Map faultMap = entry.getFaults();
                Iterator it = faultMap.values().iterator();
                while (it.hasNext()) {
                    ArrayList list = (ArrayList) it.next();
                    // Accumulate total list of faults
                    faults.addAll(list);
View Full Code Here

            if (port == null)
                throw new ServiceException(Messages.getMessage("noPort00", "" + proxyInterface.getName()));
   
            Binding binding = port.getBinding();
            SymbolTable symbolTable = wsdlParser.getSymbolTable();
            BindingEntry bEntry = symbolTable.getBindingEntry(binding.getQName());
            if(bEntry.getParameters().size() !=  proxyInterface.getMethods().length) {
                throw new ServiceException(Messages.getMessage("incompatibleSEI00", "" + proxyInterface.getName()));
           
            // TODO: Check the methods and the parameters as well.
        }
       
View Full Code Here

        if (port == null)
            throw new ServiceException(Messages.getMessage("noPort00", "" + portName));

        Binding binding = port.getBinding();
        SymbolTable symbolTable = wsdlParser.getSymbolTable();
        BindingEntry bEntry =
                symbolTable.getBindingEntry(binding.getQName());
        Iterator i = bEntry.getParameters().keySet().iterator();

        Vector calls = new Vector();
        while (i.hasNext()) {
            Operation operation = (Operation) i.next();
            javax.xml.rpc.Call call = createCall(QName.valueOf(port.getName()),
View Full Code Here

                    }

                    gen = genFactory.getGenerator(pEntry.getPortType(),
                            symbolTable);
                } else if (entry instanceof BindingEntry) {
                    BindingEntry bEntry = (BindingEntry) entry;
                    Binding binding = bEntry.getBinding();

                    // If the binding is undefined, then we're parsing a Definition
                    // that didn't contain a binding, merely a service that referred
                    // to a non-existent binding.  Don't bother writing it.
                    if (binding.isUndefined() || !bEntry.isReferenced()) {
                        continue;
                    }

                    gen = genFactory.getGenerator(binding, symbolTable);
                } else if (entry instanceof ServiceEntry) {
View Full Code Here

            }
        }

        Service service = this.getService();
        SymbolTable symbolTable = service.getWSDLParser().getSymbolTable();
        BindingEntry bEntry = symbolTable.getBindingEntry(binding.getQName());
        Parameters parameters = bEntry.getParameters(bop.getOperation());

        // loop over paramters and set up in/out params
        for (int j = 0; j < parameters.list.size(); ++j) {
            Parameter p = (Parameter) parameters.list.get(j);
            // Get the QName representing the parameter type
            QName paramType = Utils.getXSIType(p);

            // checks whether p is an IN or OUT header
            // and adds it as a header parameter else
            // add it to the body
            ParameterMode mode = modes[p.getMode()];
            if (p.isInHeader() || p.isOutHeader()) {
                this.addParameterAsHeader(p.getQName(), paramType,
                        mode, mode);
            } else {
                this.addParameter(p.getQName(), paramType, mode);
            }
        }

        Map faultMap = bEntry.getFaults();
        // Get the list of faults for this operation
        ArrayList faults = (ArrayList) faultMap.get(bop);

        // check for no faults
        if (faults == null) {
            return;
        }
        // For each fault, register its information
        for (Iterator faultIt = faults.iterator(); faultIt.hasNext();) {
            FaultInfo info = (FaultInfo) faultIt.next();
            QName qname = info.getQName();
            info.getMessage();

            // if no parts in fault, skip it!
            if (qname == null) {
                continue;
            }

            QName xmlType = info.getXMLType();
            Class clazz = getTypeMapping().getClassForQName(xmlType);
            if (clazz != null) {
                addFault(qname, clazz, xmlType, true);
            } else {
                //we cannot map from the info to a java class
                //In Axis1.1 and before this was silently swallowed. Now we log it

                log.debug(Messages.getMessage("clientNoTypemapping", xmlType.toString()));
            }
        }

        // set output type
        if (parameters.returnParam != null) {
            // Get the QName for the return Type
            QName returnType = Utils.getXSIType(parameters.returnParam);
            QName returnQName = parameters.returnParam.getQName();

            // Get the javaType
            String javaType = null;
            if (parameters.returnParam.getMIMEInfo() != null) {
                javaType = "javax.activation.DataHandler";
            }
            else {
                javaType = parameters.returnParam.getType().getName();
            }
            if (javaType == null) {
                javaType = "";
            }
            else {
                javaType = javaType + ".class";
            }
            this.setReturnType(returnType);
            try {
                Class clazz = ClassUtils.forName(javaType);
                this.setReturnClass(clazz);
            } catch (ClassNotFoundException swallowedException) {
                //log that this lookup failed,
                log.debug(Messages.getMessage("clientNoReturnClass",
                        javaType));
            }
            this.setReturnQName(returnQName);
        }
        else {
            this.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID);
        }

        boolean hasMIME = Utils.hasMIME(bEntry, bop);
        Use use = bEntry.getInputBodyType(bop.getOperation());
        setOperationUse(use);
        if (use == Use.LITERAL) {
            // Turn off encoding
            setEncodingStyle(null);
            // turn off XSI types
            setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        }
        if (hasMIME || use == Use.LITERAL) {
            // If it is literal, turn off multirefs.
            //
            // If there are any MIME types, turn off multirefs.
            // I don't know enough about the guts to know why
            // attachments don't work with multirefs, but they don't.
            setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        }

        Style style = Style.getStyle(opStyle, bEntry.getBindingStyle());
        if (style == Style.DOCUMENT && symbolTable.isWrapped()) {
            style = Style.WRAPPED;
        }
        setOperationStyle(style);
View Full Code Here

     */
    public Generator getGenerator(Binding binding, SymbolTable symbolTable) {
        if (include(binding.getQName())) {
            Generator writer = new JavaBindingWriter(emitter, binding,
                    symbolTable);
            BindingEntry bEntry = symbolTable.getBindingEntry(binding.getQName());
            bindingWriters.addStuff(writer, bEntry, symbolTable);
            return bindingWriters;
        }
        else {
            return new NoopGenerator();
View Full Code Here

            for (int i = 0; i < v.size(); ++i) {
                SymTabEntry entry = (SymTabEntry) v.elementAt(i);

                // Inspect each BindingEntry in the Symbol Table
                if (entry instanceof BindingEntry) {
                    BindingEntry bEntry = (BindingEntry) entry;
                    HashMap allOpFaults = bEntry.getFaults();
                    Iterator ops = allOpFaults.values().iterator();

                    // set the context for all faults for this binding.
                    while (ops.hasNext()) {
                        ArrayList faults = (ArrayList) ops.next();
View Full Code Here

                if (entry instanceof BindingEntry) {

                    // The SEI (Service Endpoint Interface) name
                    // is always the portType name.
                    BindingEntry bEntry = (BindingEntry) entry;
                    PortTypeEntry ptEntry = symbolTable.getPortTypeEntry(
                            bEntry.getBinding().getPortType().getQName());

                    String seiName = getServiceEndpointInterfaceJavaNameHook(ptEntry, bEntry);
                    if (seiName == null) {
                        seiName = ptEntry.getName();
                    }

                    bEntry.setDynamicVar(JavaBindingWriter.INTERFACE_NAME,
                            seiName);
                } else if (entry instanceof ServiceEntry) {
                    ServiceEntry sEntry = (ServiceEntry) entry;
                    String siName = getServiceInterfaceJavaNameHook(sEntry);    // for derived class
                    if (siName != null) {
                        sEntry.setName(siName);
                    }

                    Service service = sEntry.getService();
                    Map portMap = service.getPorts();
                    Iterator portIterator = portMap.values().iterator();

                    while (portIterator.hasNext()) {
                        Port p = (Port) portIterator.next();

                        Binding binding = p.getBinding();
                        BindingEntry bEntry =
                                symbolTable.getBindingEntry(binding.getQName());

                        // If this isn't a SOAP binding, skip it
                        if (bEntry.getBindingType() != BindingEntry.TYPE_SOAP) {
                            continue;
                        }

                        String portName = getPortJavaNameHook(p.getName());   // for derived class
                        if (portName != null) {
                            bEntry.setDynamicVar(JavaServiceWriter.PORT_NAME + ":" + p.getName(),
                                    portName);
                        }
                    }
                }
            }
View Full Code Here

                        }
                        // else if (entry instanceof MessageEntry) {
                        // we don't care about messages
                        // }
                        else if (entry instanceof BindingEntry) {
                            BindingEntry bEntry = (BindingEntry) entry;

                            // If there is no literal use, then we never see a
                            // class named directly from the binding name.  They
                            // all have suffixes:  Stub, Skeleton, Impl.
                            // If there IS literal use, then the SDI will be
                            // named after the binding name, so there is the
                            // possibility of a name clash.
                            if (bEntry.hasLiteral()) {
                                entry.setName(mangleName(entry.getName(),
                                        BINDING_SUFFIX));
                            }
                        }
                    }
View Full Code Here

TOP

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

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.