Package org.apache.axis.description

Examples of org.apache.axis.description.JavaServiceDesc


            tm = (TypeMapping)tmr.getTypeMapping(encodingStyle);
        }

        // Set up a ServiceDesc to use to introspect the Service
        if (serviceDesc == null) {
            JavaServiceDesc javaServiceDesc = new JavaServiceDesc();
            serviceDesc = javaServiceDesc;

            javaServiceDesc.setImplClass(cls);

            // Set the typeMapping to the one provided.
            serviceDesc.setTypeMapping(tm);

            javaServiceDesc.setStopClasses(stopClasses);
            serviceDesc.setAllowedMethods(allowedMethods);
            javaServiceDesc.setDisallowedMethods(disallowedMethods);
            serviceDesc.setStyle(style);
            serviceDesc.setUse(use);

            // 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 JavaServiceDesc();

                serviceDesc2.setImplClass(implCls);

                // Set the typeMapping to the one provided.
                serviceDesc2.setTypeMapping(tm);
View Full Code Here


       
        LOG.debug("Publishing JAX-RPC '" + portInfo.getPortComponentName()
                  + "' service at " + portInfo.getContextURI());
       
        ServiceInfo serviceInfo = AxisServiceBuilder.createServiceInfo(portInfo, cl);
        JavaServiceDesc serviceDesc = serviceInfo.getServiceDesc();

        targetGBean.setAttribute("pojoClassName", servletClassName);
        RPCProvider provider = new POJOProvider();

        SOAPService service = new SOAPService(null, provider, null);
        service.setServiceDescription(serviceDesc);
        service.setOption("className", servletClassName);

        HandlerInfoChainFactory handlerInfoChainFactory = new HandlerInfoChainFactory(serviceInfo.getHandlerInfos());
        service.setOption(org.apache.axis.Constants.ATTR_HANDLERINFOCHAIN, handlerInfoChainFactory);

        URI location;
        try {
            location = new URI(serviceDesc.getEndpointURL());
        } catch (URISyntaxException e) {
            throw new DeploymentException("Invalid webservice endpoint URI", e);
        }
        URI wsdlURI;
        try {
            wsdlURI = new URI(serviceDesc.getWSDLFile());
        } catch (URISyntaxException e) {
            throw new DeploymentException("Invalid wsdl URI", e);

        }
View Full Code Here

        LOG.debug("Publishing EJB JAX-RPC '" + portInfo.getPortComponentName()
                  + "' service at " + portInfo.getContextURI());
       
        ServiceInfo serviceInfo = AxisServiceBuilder.createServiceInfo(portInfo, classLoader);
        targetGBean.setAttribute("serviceInfo", serviceInfo);
        JavaServiceDesc serviceDesc = serviceInfo.getServiceDesc();
        URI location = portInfo.getContextURI();
        targetGBean.setAttribute("location", location);
        URI wsdlURI;
        try {
            wsdlURI = new URI(serviceDesc.getWSDLFile());
        } catch (URISyntaxException e) {
            throw new DeploymentException("Invalid wsdl URI", e);
        }
        targetGBean.setAttribute("wsdlURI", wsdlURI);
        return true;
View Full Code Here

        this.soapHandler = webContainers.iterator().next();

        RPCProvider provider = new EjbContainerProvider(ejbDeploymentContext.getDeploymentInfo(), serviceInfo.getHandlerInfos());
        SOAPService service = new SOAPService(null, provider, null);

        JavaServiceDesc serviceDesc = serviceInfo.getServiceDesc();
        service.setServiceDescription(serviceDesc);

        ClassLoader classLoader = ejbDeploymentContext.getClassLoader();

        Class serviceEndpointInterface =
                classLoader.loadClass(ejbDeploymentContext.getServiceEndpointInterfaceName());

        service.setOption("className", serviceEndpointInterface.getName());
        serviceDesc.setImplClass(serviceEndpointInterface);

        AxisWebServiceContainer axisContainer = new AxisWebServiceContainer(location, wsdlURI, service, serviceInfo.getWsdlMap(), classLoader);
        if (soapHandler != null) {
            soapHandler.addWebService(location.getPath(),
                    virtualHosts,
View Full Code Here

        String clsName = getServiceClassName(service);
        if (clsName == null) {
            throw new AxisFault(Messages.getMessage("noServiceClass"));
        }
        Class cls = getServiceClass(clsName, service, msgContext);
        JavaServiceDesc serviceDescription = (JavaServiceDesc)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

            tm = (TypeMapping)tmr.getTypeMapping(encodingStyle);
        }

        // Set up a ServiceDesc to use to introspect the Service
        if (serviceDesc == null) {
            JavaServiceDesc javaServiceDesc = new JavaServiceDesc();
            serviceDesc = javaServiceDesc;

            javaServiceDesc.setImplClass(cls);

            // Set the typeMapping to the one provided.
            serviceDesc.setTypeMapping(tm);

            javaServiceDesc.setStopClasses(stopClasses);
            serviceDesc.setAllowedMethods(allowedMethods);
            javaServiceDesc.setDisallowedMethods(disallowedMethods);
            serviceDesc.setStyle(style);
            serviceDesc.setUse(use);

            // 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 JavaServiceDesc();

                serviceDesc2.setImplClass(implCls);

                // Set the typeMapping to the one provided.
                serviceDesc2.setTypeMapping(tm);
View Full Code Here

    }

    public void testInvokeSOAP() throws Exception {

        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        JavaServiceDesc serviceDesc = new JavaServiceDesc();
        serviceDesc.setEndpointURL("http://127.0.0.1:8080/axis/services/echo");
        //serviceDesc.setWSDLFile(portInfo.getWsdlURL().toExternalForm());
        serviceDesc.setStyle(Style.RPC);
        serviceDesc.setUse(Use.ENCODED);

        TypeMappingRegistryImpl tmr = new TypeMappingRegistryImpl();
        tmr.doRegisterFromVersion("1.3");
        TypeMapping typeMapping = tmr.getOrMakeTypeMapping(serviceDesc.getUse().getEncoding());

        serviceDesc.setTypeMappingRegistry(tmr);
        serviceDesc.setTypeMapping(typeMapping);

        OperationDesc op = new OperationDesc();
        op.setName("echoString");
        op.setStyle(Style.RPC);
        op.setUse(Use.ENCODED);
        Class beanClass = EchoBean.class;
        op.setMethod(beanClass.getMethod("echoString", String.class));
        ParameterDesc parameter =
            new ParameterDesc(
                new QName("http://ws.apache.org/echosample", "in0"),
                ParameterDesc.IN,
                typeMapping.getTypeQName(String.class),
                String.class,
                false,
                false);
        op.addParameter(parameter);
        serviceDesc.addOperationDesc(op);

        serviceDesc.getOperations();
        ReadOnlyServiceDesc sd = new ReadOnlyServiceDesc(serviceDesc);

        Class pojoClass = cl.loadClass("org.apache.openejb.server.axis.EchoBean");

        RPCProvider provider = new PojoProvider();
        SOAPService service = new SOAPService(null, provider, null);
        service.setServiceDescription(sd);
        service.setOption("className","org.apache.openejb.server.axis.EchoBean");
        URL wsdlURL = new URL("http://fake/echo.wsdl");
        URI location = new URI(serviceDesc.getEndpointURL());
        Map wsdlMap = new HashMap();

        AxisWsContainer container = new AxisWsContainer(wsdlURL, service, wsdlMap, cl);

        InputStream in = cl.getResourceAsStream("echoString-req.txt");
View Full Code Here

        // todo build JaxRpcServiceInfo in assembler
        JaxRpcServiceInfo serviceInfo = getJaxRpcServiceInfo(classLoader);

        // Build java service descriptor
        JavaServiceDescBuilder javaServiceDescBuilder = new JavaServiceDescBuilder(serviceInfo, classLoader);
        JavaServiceDesc serviceDesc = javaServiceDescBuilder.createServiceDesc();

        // Create service
        RPCProvider provider = new EjbContainerProvider(deploymentInfo, createHandlerInfos(port.getHandlerChains()));
        SOAPService service = new SOAPService(null, provider, null);
        service.setServiceDescription(serviceDesc);

        // Set class name
        service.setOption("className", deploymentInfo.getServiceEndpointInterface().getName());
        serviceDesc.setImplClass(deploymentInfo.getServiceEndpointInterface());

        // Create container
        AxisWsContainer container = new AxisWsContainer(port.getWsdlUrl(), service, null, classLoader);
        wsContainers.put(deploymentInfo.getDeploymentID().toString(), container);
        return container;
View Full Code Here

        // todo build JaxRpcServiceInfo in assembler
        JaxRpcServiceInfo serviceInfo = getJaxRpcServiceInfo(classLoader);

        // Build java service descriptor
        JavaServiceDescBuilder javaServiceDescBuilder = new JavaServiceDescBuilder(serviceInfo, classLoader);
        JavaServiceDesc serviceDesc = javaServiceDescBuilder.createServiceDesc();

        // Create service
        RPCProvider provider = new PojoProvider();
        SOAPService service = new SOAPService(null, provider, null);
        service.setServiceDescription(serviceDesc);
View Full Code Here

            serviceEndpointInterface = classLoader.loadClass(serviceInfo.serviceEndpointInterface);
        } catch (ClassNotFoundException e) {
            throw new OpenEJBException("Unable to load the service endpoint interface " + serviceInfo.serviceEndpointInterface, e);
        }

        JavaServiceDesc serviceDesc = new JavaServiceDesc();
        serviceDesc.setName(serviceInfo.name);
        serviceDesc.setEndpointURL(serviceInfo.endpointURL);
        serviceDesc.setWSDLFile(serviceInfo.wsdlFile);

        BindingStyle bindingStyle = serviceInfo.defaultBindingStyle;
        switch (bindingStyle) {
            case RPC_ENCODED:
                serviceDesc.setStyle(Style.RPC);
                serviceDesc.setUse(Use.ENCODED);
                break;
            case RPC_LITERAL:
                serviceDesc.setStyle(Style.RPC);
                serviceDesc.setUse(Use.LITERAL);
                break;
            case DOCUMENT_ENCODED:
                serviceDesc.setStyle(Style.DOCUMENT);
                serviceDesc.setUse(Use.ENCODED);
                break;
            case DOCUMENT_LITERAL:
                serviceDesc.setStyle(Style.DOCUMENT);
                serviceDesc.setUse(Use.LITERAL);
                break;
            case DOCUMENT_LITERAL_WRAPPED:
                serviceDesc.setStyle(Style.WRAPPED);
                serviceDesc.setUse(Use.LITERAL);
                break;
        }

        // Operations
        for (JaxRpcOperationInfo operationInfo : serviceInfo.operations) {
            OperationDesc operationDesc = buildOperationDesc(operationInfo, serviceEndpointInterface);
            serviceDesc.addOperationDesc(operationDesc);
        }

        // Type mapping registry
        TypeMappingRegistryImpl typeMappingRegistry = new TypeMappingRegistryImpl();
        typeMappingRegistry.doRegisterFromVersion("1.3");
        serviceDesc.setTypeMappingRegistry(typeMappingRegistry);

        // Type mapping
        TypeMapping typeMapping = typeMappingRegistry.getOrMakeTypeMapping(serviceDesc.getUse().getEncoding());
        serviceDesc.setTypeMapping(typeMapping);

        // Types
        for (JaxRpcTypeInfo type : serviceInfo.types) {
            registerType(type, typeMapping);
        }
View Full Code Here

TOP

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

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.