Package org.apache.axis.description

Examples of org.apache.axis.description.ServiceDesc


            SOAPService service = new SOAPService(new RPCProvider());

            service.setOption("className", "test.encoding.TestArrayListConversions");
            service.setOption("allowedMethods", "*");

            ServiceDesc desc = service.getInitializedServiceDesc(null);
            desc.setDefaultNamespace(SERVICE_NAME);

            provider.deployService(SERVICE_NAME, service);
        } catch (Exception exp) {
            exp.printStackTrace();
        }
View Full Code Here


            defaultTM = DefaultTypeMappingImpl.getSingleton();
        }

        // Set up a ServiceDesc to use to introspect the Service
        if (serviceDesc == null) {
            serviceDesc = new ServiceDesc();
            serviceDesc.setImplClass(cls);

            // Set the typeMapping to the one provided.
            // If not available use the default TM
            if (tm != null) {
                serviceDesc.setTypeMapping(tm);
            } else {
                serviceDesc.setTypeMapping(defaultTM);
            }

            serviceDesc.setStopClasses(stopClasses);
            serviceDesc.setAllowedMethods(allowedMethods);
            serviceDesc.setDisallowedMethods(disallowedMethods);

            // If the class passed in is a portType,
            // there may be an implClass that is used to
            // obtain the method parameter names.  In this case,
            // a serviceDesc2 is built to get the method parameter names.
            if (implCls != null &&
                    implCls != cls &&
                    serviceDesc2 == null) {
                serviceDesc2 = new ServiceDesc();
                serviceDesc2.setImplClass(implCls);

                // Set the typeMapping to the one provided.
                // If not available use the default TM
                if (tm != null) {
View Full Code Here

        // Obtain our possible operations
        if (operations == null && msgContext != null) {
            SOAPService service    = msgContext.getService();
            if (service != null) {
                ServiceDesc serviceDesc =
                        service.getInitializedServiceDesc(msgContext);
               
                String lc = Utils.xmlNameToJava(name);
                if (serviceDesc == null) {
                    AxisFault.makeFault(
                            new ClassNotFoundException(
                                    Messages.getMessage("noClassForService00",
                                                         lc)));
                }

                operations = serviceDesc.getOperationsByName(lc);
            }
        }
        this.operations = operations;
    }
View Full Code Here

        writer.println("<h2>And now... Some Services</h2>");
        Iterator i = engine.getConfig().getDeployedServices();
        String baseURL = getWebappBase(request)+"/services/";
        writer.println("<ul>");
        while (i.hasNext()) {
            ServiceDesc sd = (ServiceDesc)i.next();
            StringBuffer sb = new StringBuffer();
            sb.append("<li>");
            String name = sd.getName();
            sb.append(name);
            sb.append(" <a href=\"");
            sb.append(baseURL);
            sb.append(name);
            sb.append("?wsdl\"><i>(wsdl)</i></a></li>");
            writer.println(sb.toString());
            ArrayList operations = sd.getOperations();
            if (!operations.isEmpty()) {
                writer.println("<ul>");
                for (Iterator it = operations.iterator(); it.hasNext();) {
                    OperationDesc desc = (OperationDesc) it.next();
                    writer.println("<li>" + desc.getName());
View Full Code Here

            log.debug("Enter: JavaProvider::generateWSDL (" + this + ")");

        /* Find the service we're invoking so we can grab it's options */
        /***************************************************************/
        SOAPService service = msgContext.getService();
        ServiceDesc serviceDesc = service.getInitializedServiceDesc(msgContext);

        // Calculate the appropriate namespaces for the WSDL we're going
        // to put out.
        //
        // If we've been explicitly told which namespaces to use, respect
        // that.  If not:
        //
        // The "interface namespace" should be either:
        // 1) The namespace of the ServiceDesc
        // 2) The transport URL (if there's no ServiceDesc ns)

        try {
            // Location URL is whatever is explicitly set in the MC
            String locationUrl =
                    msgContext.getStrProp(MessageContext.WSDLGEN_SERV_LOC_URL);

            if (locationUrl == null) {
                // If nothing, try what's explicitly set in the ServiceDesc
                locationUrl = serviceDesc.getEndpointURL();
            }

            if (locationUrl == null) {
                // If nothing, use the actual transport URL
                locationUrl = msgContext.getStrProp(MessageContext.TRANS_URL);
            }

            // Interface namespace is whatever is explicitly set
            String interfaceNamespace =
                    msgContext.getStrProp(MessageContext.WSDLGEN_INTFNAMESPACE);

            if (interfaceNamespace == null) {
                // If nothing, use the default namespace of the ServiceDesc
                interfaceNamespace = serviceDesc.getDefaultNamespace();
            }

            if (interfaceNamespace == null) {
                // If nothing still, use the location URL determined above
                interfaceNamespace = locationUrl;
            }

//  Do we want to do this?
//
//            if (locationUrl == null) {
//                locationUrl = url;
//            } else {
//                try {
//                    URL urlURL = new URL(url);
//                    URL locationURL = new URL(locationUrl);
//                    URL urlTemp = new URL(urlURL.getProtocol(),
//                            locationURL.getHost(),
//                            locationURL.getPort(),
//                            urlURL.getFile());
//                    interfaceNamespace += urlURL.getFile();
//                    locationUrl = urlTemp.toString();
//                } catch (Exception e) {
//                    locationUrl = url;
//                    interfaceNamespace = url;
//                }
//            }

            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);

            Style style = serviceDesc.getStyle();
            if (style == Style.RPC) {
                emitter.setMode(Emitter.MODE_RPC);
            } else if (style == Style.DOCUMENT) {
                emitter.setMode(Emitter.MODE_DOCUMENT);
            } else if (style == Style.WRAPPED) {
                emitter.setMode(Emitter.MODE_DOC_WRAPPED);
            }

            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 ||
View Full Code Here

        String clsName = getServiceClassName(service);
        if (clsName == null) {
            throw new AxisFault(Messages.getMessage("noServiceClass"));
        }
        Class cls = getServiceClass(clsName, service, msgContext);
        ServiceDesc serviceDescription = service.getServiceDescription();

        // And the allowed methods, if necessary
        if (serviceDescription.getAllowedMethods() == null && service != null) {
            String allowedMethods = getAllowedMethods(service);
            if (allowedMethods != null && !"*".equals(allowedMethods)) {
                ArrayList methodList = new ArrayList();
                StringTokenizer tokenizer = new StringTokenizer(allowedMethods, " ,");
                while (tokenizer.hasMoreTokens()) {
                    methodList.add(tokenizer.nextToken());
                }
                serviceDescription.setAllowedMethods(methodList);
            }
        }

        serviceDescription.loadServiceDescByIntrospection(cls);
    }
View Full Code Here

        writer.println("<h2>And now... Some Services</h2>");
        Iterator i = engine.getConfig().getDeployedServices();
        String baseURL = getWebappBase(request)+"/services/";
        writer.println("<ul>");
        while (i.hasNext()) {
            ServiceDesc sd = (ServiceDesc)i.next();
            StringBuffer sb = new StringBuffer();
            sb.append("<li>");
            String name = sd.getName();
            sb.append(name);
            sb.append(" <a href=\"");
            sb.append(baseURL);
            sb.append(name);
            sb.append("?wsdl\"><i>(wsdl)</i></a></li>");
            writer.println(sb.toString());
            ArrayList operations = sd.getOperations();
            if (!operations.isEmpty()) {
                writer.println("<ul>");
                for (Iterator it = operations.iterator(); it.hasNext();) {
                    OperationDesc desc = (OperationDesc) it.next();
                    writer.println("<li>" + desc.getName());
View Full Code Here

        // Obtain our possible operations
        if (operations == null && msgContext != null) {
            SOAPService service    = msgContext.getService();
            if (service != null) {
                ServiceDesc serviceDesc =
                        service.getInitializedServiceDesc(msgContext);
               
                String lc = Utils.xmlNameToJava(name);
                if (serviceDesc == null) {
                    AxisFault.makeFault(
                            new ClassNotFoundException(
                                    Messages.getMessage("noClassForService00",
                                                         lc)));
                }

                operations = serviceDesc.getOperationsByName(lc);
            }
        }

        if (operations != null && operations.length > 0) {
            // if we're document style, the top level element is important
View Full Code Here

            defaultTM = DefaultTypeMappingImpl.getSingleton();
        }

        // Set up a ServiceDesc to use to introspect the Service
        if (serviceDesc == null) {
            serviceDesc = new ServiceDesc();
            serviceDesc.setImplClass(cls);

            // Set the typeMapping to the one provided.
            // If not available use the default TM
            if (tm != null) {
                serviceDesc.setTypeMapping(tm);
            } else {
                serviceDesc.setTypeMapping(defaultTM);
            }

            serviceDesc.setStopClasses(stopClasses);
            serviceDesc.setAllowedMethods(allowedMethods);
            serviceDesc.setDisallowedMethods(disallowedMethods);

            // If the class passed in is a portType,
            // there may be an implClass that is used to
            // obtain the method parameter names.  In this case,
            // a serviceDesc2 is built to get the method parameter names.
            if (implCls != null &&
                    implCls != cls &&
                    serviceDesc2 == null) {
                serviceDesc2 = new ServiceDesc();
                serviceDesc2.setImplClass(implCls);

                // Set the typeMapping to the one provided.
                // If not available use the default TM
                if (tm != null) {
View Full Code Here

            }

        }

        if (serviceHandler != null) {
            ServiceDesc desc = serviceHandler.getInitializedServiceDesc(this);

            if (desc != null) {
                possibleOperations = desc.getOperationsByQName(qname);
                setOperationStyle(desc.getStyle());
            }
        }

        return possibleOperations;
    }
View Full Code Here

TOP

Related Classes of org.apache.axis.description.ServiceDesc

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.