Examples of Emitter


Examples of org.apache.axis.wsdl.fromJava.Emitter

            AxisServiceConfig axisConfig = getConfiguration(cls);
            if (axisConfig != null) {
                allowedMethods = axisConfig.getAllowedMethods();
            }
           
            Emitter emitter = new Emitter();
           
            // service alias may be provided if exact naming is required,
            // otherwise Axis will name it according to the implementing class name           
            String alias = (String)service.getOption("alias");
            if(alias != null) emitter.setServiceElementName(alias);
           
            emitter.setMode(service.getStyle());
            emitter.setClsSmart(cls,url);
            emitter.setAllowedMethods(allowedMethods);
            emitter.setIntfNamespace(url);
            emitter.setLocationUrl(url);
            emitter.setServiceDesc(msgContext.getService().getServiceDescription());
            emitter.setTypeMapping((TypeMapping)msgContext.getTypeMappingRegistry().
                                   getTypeMapping(Constants.URI_CURRENT_SOAP_ENC));
            emitter.setDefaultTypeMapping((TypeMapping)msgContext.getTypeMappingRegistry().
                                          getDefaultTypeMapping());
            Document  doc = emitter.emit(Emitter.MODE_ALL);

            msgContext.setProperty("WSDL", doc);
        } catch (NoClassDefFoundError e) {
            throw new AxisFault(e.toString(), e);
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

        int size = clOptions.size();

        try {

            // Instantiate the emitter
            Emitter emitter = new Emitter();

            // Parse the options and configure the emitter as appropriate.
            for (int i = 0; i < size; i++) {
                CLOption option = (CLOption)clOptions.get(i);

                switch (option.getId()) {
                    case CLOption.TEXT_ARGUMENT:
                        if (className != null) {
                            printUsage();
                        }
                        className = option.getArgument();
                        break;

                    case METHODS_ALLOWED_OPT:
                        emitter.setAllowedMethods(option.getArgument());
                        break;

                    case INHERITED_CLASS_OPT:
                        emitter.setUseInheritedMethods(true);
                        break;

                    case FACTORY_CLASS_OPT:
                        emitter.setFactory(option.getArgument());
                        break;

                    case IMPL_CLASS_OPT:
                        emitter.setImplCls(option.getArgument());
                        break;

                    case HELP_OPT:
                        printUsage();
                        break;

                    case OUTPUT_WSDL_MODE_OPT:
                        String modeArg = option.getArgument();
                        if ("All".equalsIgnoreCase(modeArg))
                            mode = Emitter.MODE_ALL;
                        else if ("Interface".equalsIgnoreCase(modeArg))
                            mode = Emitter.MODE_INTERFACE;
                        else if ("Implementation".equalsIgnoreCase(modeArg))
                            mode = Emitter.MODE_IMPLEMENTATION;
                        else {
                            mode = Emitter.MODE_ALL;
                            System.err.println(JavaUtils.getMessage("j2wmodeerror", modeArg));
                        }
                        break;

                    case OUTPUT_OPT:
                        wsdlFilename = option.getArgument();
                        break;

                    case OUTPUT_IMPL_OPT:
                        wsdlImplFilename = option.getArgument();
                        break;

                    case PACKAGE_OPT:
                        String packageName = option.getArgument(0);
                        String namespace = option.getArgument(1);
                        namespaceMap.put(packageName, namespace);
                        break;

                    case NAMESPACE_OPT:
                        emitter.setIntfNamespace(option.getArgument());
                        break;

                    case NAMESPACE_IMPL_OPT:
                        emitter.setImplNamespace(option.getArgument());
                        break;

                    case SERVICE_ELEMENT_NAME_OPT:
                        emitter.setServiceElementName(option.getArgument());
                        break;

                    case SERVICE_PORT_NAME_OPT:
                        emitter.setServicePortName(option.getArgument());
                        break;

                    case LOCATION_OPT:
                        emitter.setLocationUrl(option.getArgument());
                        locationSet = true;
                        break;

                    case LOCATION_IMPORT_OPT:
                        emitter.setImportUrl(option.getArgument());
                        break;
                       
                    case METHODS_NOTALLOWED_OPT:
                        emitter.setDisallowedMethods(option.getArgument());
                        break;
                       
                    case PORTTYPE_NAME_OPT:
                        emitter.setPortTypeName(option.getArgument());
                        break;
                       
                    case STOP_CLASSES_OPT:
                        emitter.setStopClasses(option.getArgument());
                        break;

                    case TYPEMAPPING_OPT:
                        String value = option.getArgument();
                        if (value.equals("1.1")) {
                            emitter.setDefaultTypeMapping(
                                DefaultTypeMappingImpl.getSingleton());
                        } else if (value.equals("1.2")) {
                            emitter.setDefaultTypeMapping(
                                DefaultSOAP12TypeMappingImpl.create());
                        } else {
                            System.out.println(JavaUtils.getMessage("j2wBadTypeMapping00"));
                        }
                        break;
                       
                }
            }

            // Can't proceed without a class name
            if ((className == null)) {
                printUsage();
            }

            if (!locationSet && (mode == Emitter.MODE_ALL ||
                                 mode == Emitter.MODE_IMPLEMENTATION)) {
                System.out.println(JavaUtils.getMessage("j2wMissingLocation00"));
                printUsage();
            }

            // Default to SOAP 1.2 JAX-RPC mapping
            if (emitter.getDefaultTypeMapping() == null) {
                emitter.setDefaultTypeMapping(DefaultSOAP12TypeMappingImpl.create());
            }           
               
            if (!namespaceMap.isEmpty()) {
                emitter.setNamespaceMap(namespaceMap);
            }

            // Find the class using the name
            emitter.setCls(className);

            // Generate a full wsdl, or interface & implementation wsdls
            if (wsdlImplFilename == null) {
                emitter.emit(wsdlFilename, mode);
            } else {
                emitter.emit(wsdlFilename, wsdlImplFilename);
            }
        }
        catch (Throwable t) {
            t.printStackTrace();
        }
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

            log("\texcluded:" + exclude, Project.MSG_VERBOSE);
            log("\tstopClasses:" + stopClasses, Project.MSG_VERBOSE);
            log("\ttypeMappingVersion:" + tm, Project.MSG_VERBOSE);
           
            // Instantiate the emitter
            Emitter emitter = new Emitter();

            if (!namespaceMap.isEmpty()) {
                emitter.setNamespaceMap(namespaceMap);
            }
            if (servicePortName != null)
                emitter.setServicePortName(servicePortName);
            log("Java2WSDL " + className, Project.MSG_INFO);
            emitter.setCls(className);
            if (implClass != null)
                emitter.setImplCls(implClass);
            if (factory != null)
                emitter.setFactory(factory);
            if (exclude != null)
                emitter.setDisallowedMethods(exclude);
            if (stopClasses != null)
                emitter.setStopClasses(stopClasses);

            if (tm.equals("1.1")) {
                emitter.setDefaultTypeMapping(DefaultTypeMappingImpl.getSingleton());
            } else {
                emitter.setDefaultTypeMapping(DefaultSOAP12TypeMappingImpl.create());
            }

            emitter.setIntfNamespace(namespace);
            emitter.setLocationUrl(location);
            emitter.setUseInheritedMethods(useInheritedMethods);
            emitter.emit(output, Emitter.MODE_ALL);
        } catch (Throwable t) {
            StringWriter writer = new StringWriter();
            t.printStackTrace(new PrintWriter(writer));
            log(writer.getBuffer().toString(), Project.MSG_ERR);
            throw new BuildException("Error while running " + getClass().getName(), t);
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

            log("\toutputImpl:" + outputImpl, Project.MSG_VERBOSE);
            log("\tnamespaceImpl:" + namespaceImpl, Project.MSG_VERBOSE);
            log("\tlocationImport:" + locationImport, Project.MSG_VERBOSE);
           
            // Instantiate the emitter
            Emitter emitter = new Emitter();

            if (!namespaceMap.isEmpty()) {
                emitter.setNamespaceMap(namespaceMap);
            }
            if (servicePortName != null)
                emitter.setServicePortName(servicePortName);
            if (portTypeName != null)
                emitter.setPortTypeName(portTypeName);
            log("Java2WSDL " + className, Project.MSG_INFO);
            emitter.setCls(className);
            if (implClass != null)
                emitter.setImplCls(implClass);
            if (exclude != null)
                emitter.setDisallowedMethods(exclude);
            if (stopClasses != null)
                emitter.setStopClasses(stopClasses);

            if (tm.equals("1.1")) {
                emitter.setDefaultTypeMapping(DefaultTypeMappingImpl.getSingleton());
            } else {
                emitter.setDefaultTypeMapping(DefaultSOAP12TypeMappingImpl.create());
            }
            if (style != null) {
                if (style.equalsIgnoreCase("DOCUMENT")) {
                    emitter.setMode(Emitter.MODE_DOCUMENT);
                } else if (style.equalsIgnoreCase("RPC")) {
                    emitter.setMode(Emitter.MODE_RPC);
                }
            }
            emitter.setIntfNamespace(namespace);
            emitter.setImplNamespace(namespaceImpl);
            emitter.setLocationUrl(location);
            emitter.setImportUrl(locationImport);
            emitter.setUseInheritedMethods(useInheritedMethods);
            if (outputImpl == null) {
                // Normal case
                emitter.emit(output, Emitter.MODE_ALL);
            } else {
                // Emit interface and implementation wsdls
                emitter.emit(output, outputImpl);
            }
        } catch (Throwable t) {
            StringWriter writer = new StringWriter();
            t.printStackTrace(new PrintWriter(writer));
            log(writer.getBuffer().toString(), Project.MSG_ERR);
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

    /**
     * Instantiate an Emitter         
     */
    protected Emitter createEmitter() {
        return new Emitter();
    } // createEmitter
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

     * Instantiate an Emitter
     *
     * @return
     */
    protected Emitter createEmitter() {
        return new Emitter();
    }    // createEmitter
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

            //                  locationUrl = url;
            //                  interfaceNamespace = url;
            //              }
            //          }

            Emitter emitter = new Emitter();

            // This seems like a good idea, but in fact isn't because the
            // emitter will figure out a reasonable name (<classname>Service)
            // for the WSDL service element name.  We provide the 'alias'
            // setting to explicitly set this name. See bug 13262 for more info.
            //emitter.setServiceElementName(serviceDesc.getName());

            // service alias may be provided if exact naming is required,
            // otherwise Axis will name it according to the implementing class name
            String alias = (String) service.getOption("alias");
            if (alias != null)
                emitter.setServiceElementName(alias);

            // Set style/use
            emitter.setStyle(serviceDesc.getStyle());
            emitter.setUse(serviceDesc.getUse());

            if (serviceDesc instanceof JavaServiceDesc) {
                emitter.setClsSmart(((JavaServiceDesc)serviceDesc).getImplClass(),
                                    locationUrl);
            }

            // If a wsdl target namespace was provided, use the targetNamespace.
            // Otherwise use the interfaceNamespace constructed above.
            String targetNamespace = (String) service.getOption(OPTION_WSDL_TARGETNAMESPACE);
            if (targetNamespace == null || targetNamespace.length() == 0) {
                targetNamespace = interfaceNamespace;
            }
            emitter.setIntfNamespace(targetNamespace);

            emitter.setLocationUrl(locationUrl);
            emitter.setServiceDesc(serviceDesc);
            emitter.setTypeMapping((TypeMapping) msgContext.getTypeMappingRegistry().getTypeMapping(serviceDesc.getUse().getEncoding()));
            emitter.setDefaultTypeMapping((TypeMapping) msgContext.getTypeMappingRegistry().getDefaultTypeMapping());

            String wsdlPortType = (String) service.getOption(OPTION_WSDL_PORTTYPE);
            String wsdlServiceElement = (String) service.getOption(OPTION_WSDL_SERVICEELEMENT);
            String wsdlServicePort = (String) service.getOption(OPTION_WSDL_SERVICEPORT);

            if (wsdlPortType != null && wsdlPortType.length() > 0) {
                emitter.setPortTypeName(wsdlPortType);
            }
            if (wsdlServiceElement != null && wsdlServiceElement.length() > 0) {
                emitter.setServiceElementName(wsdlServiceElement);
            }
            if (wsdlServicePort != null && wsdlServicePort.length() > 0) {
                emitter.setServicePortName(wsdlServicePort);
            }

            String wsdlInputSchema = (String) service.getOption(OPTION_WSDL_INPUTSCHEMA);
            if (null != wsdlInputSchema && wsdlInputSchema.length() > 0) {
                emitter.setInputSchema(wsdlInputSchema);
            }

            Document doc = emitter.emit(Emitter.MODE_ALL);

            msgContext.setProperty("WSDL", doc);
        } catch (NoClassDefFoundError e) {
            entLog.info(Messages.getMessage("toAxisFault00"), e);
            throw new AxisFault(e.toString(), e);
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

    /**
     * Instantiate an Emitter         
     */
    protected Emitter createEmitter() {
        return new Emitter();
    } // createEmitter
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

//                    locationUrl = url;
//                    interfaceNamespace = url;
//                }
//            }

            Emitter emitter = new Emitter();

            // Set the name for the target service.
            emitter.setServiceElementName(serviceDesc.getName());
           
            // service alias may be provided if exact naming is required,
            // otherwise Axis will name it according to the implementing class name
            String alias = (String)service.getOption("alias");
            if(alias != null) emitter.setServiceElementName(alias);

            // Set style/use
            emitter.setStyle(serviceDesc.getStyle());
            emitter.setUse(serviceDesc.getUse());

            emitter.setClsSmart(serviceDesc.getImplClass(), locationUrl);

            // If a wsdl target namespace was provided, use the targetNamespace.
            // Otherwise use the interfaceNamespace constructed above.
            String targetNamespace = (String) service.getOption(OPTION_WSDL_TARGETNAMESPACE);
            if (targetNamespace == null ||
                targetNamespace.length() == 0) {
                targetNamespace = interfaceNamespace;
            }
            emitter.setIntfNamespace(targetNamespace);

            emitter.setLocationUrl(locationUrl);
            emitter.setServiceDesc(serviceDesc);
            emitter.setTypeMapping((TypeMapping)msgContext.getTypeMappingRegistry()
                                       .getTypeMapping(serviceDesc.getUse().getEncoding()));
            emitter.setDefaultTypeMapping((TypeMapping)msgContext.getTypeMappingRegistry().
                                          getDefaultTypeMapping());

            String wsdlPortType = (String) service.getOption(OPTION_WSDL_PORTTYPE);
            String wsdlServiceElement = (String) service.getOption(OPTION_WSDL_SERVICEELEMENT);
            String wsdlServicePort = (String) service.getOption(OPTION_WSDL_SERVICEPORT);

            if (wsdlPortType != null && wsdlPortType.length() > 0) {
                emitter.setPortTypeName(wsdlPortType);
            }
            if (wsdlServiceElement != null && wsdlServiceElement.length() > 0) {
                emitter.setServiceElementName(wsdlServiceElement);
            }
            if (wsdlServicePort != null && wsdlServicePort.length() > 0) {
                emitter.setServicePortName(wsdlServicePort);
            }

            String wsdlInputSchema = (String)
                service.getOption(OPTION_WSDL_INPUTSCHEMA);
            if (null != wsdlInputSchema && wsdlInputSchema.length() > 0) {
                emitter.setInputSchema(wsdlInputSchema);
            }

            Document  doc = emitter.emit(Emitter.MODE_ALL);

            msgContext.setProperty("WSDL", doc);
        } catch (NoClassDefFoundError e) {
            entLog.info( Messages.getMessage("toAxisFault00"), e );
            throw new AxisFault(e.toString(), e);
View Full Code Here

Examples of org.apache.axis.wsdl.toJava.Emitter

    /**
     * Instantiate an extension of the Parser
     */
    protected Parser createParser() {
        return new Emitter();
    } // createParser
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.