Examples of JavaServiceDesc


Examples of org.apache.axis.description.JavaServiceDesc

            //not ours
            return false;
        }
        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

Examples of org.apache.axis.description.JavaServiceDesc

    public static final String XSD_NS = "http://www.w3.org/2001/XMLSchema";
    public static final QName SCHEMA_QNAME = new QName(XSD_NS, "schema");


    public static ServiceInfo createServiceInfo(PortInfo portInfo, ClassLoader classLoader) throws DeploymentException {
        JavaServiceDesc serviceDesc = createServiceDesc(portInfo, classLoader);
        List handlerInfos = WSDescriptorParser.createHandlerInfoList(portInfo.getHandlers(), classLoader);
        SchemaInfoBuilder schemaInfoBuilder = portInfo.getSchemaInfoBuilder();
        Map rawWsdlMap = schemaInfoBuilder.getWsdlMap();
        Map wsdlMap = rewriteWsdlMap(portInfo, rawWsdlMap);
        return new ServiceInfo(serviceDesc, handlerInfos, wsdlMap);
View Full Code Here

Examples of org.apache.axis.description.JavaServiceDesc

        Map exceptionMap = WSDescriptorParser.getExceptionMap(portInfo.getJavaWsdlMapping());
        SchemaInfoBuilder schemaInfoBuilder = portInfo.getSchemaInfoBuilder();
        Map schemaTypeKeyToSchemaTypeMap = schemaInfoBuilder.getSchemaTypeKeyToSchemaTypeMap();

        JavaServiceDesc serviceDesc = new JavaServiceDesc();

        String location = getAddressLocation(port);
        serviceDesc.setEndpointURL(location);
        serviceDesc.setWSDLFile(portInfo.getWsdlLocation());
        Binding binding = port.getBinding();

        serviceDesc.setStyle(getStyle(binding));


        BindingInput bindingInput = ((BindingOperation) binding.getBindingOperations().get(0)).getBindingInput();
        SOAPBody soapBody = (SOAPBody) SchemaInfoBuilder.getExtensibilityElement(SOAPBody.class, bindingInput.getExtensibilityElements());

        if (soapBody.getUse() != null) {
            Use use = Use.getUse(soapBody.getUse());
            serviceDesc.setUse(use);
        } else {
            serviceDesc.setUse(Use.ENCODED);
        }
        boolean hasEncoded = serviceDesc.getUse() == Use.ENCODED;

        boolean isLightweight = portInfo.getServiceEndpointInterfaceMapping() == null;

//        if (isLightweight) {
//            validateLightweightMapping(portInfo.getDefinition());
//        }

        Collection operations = new ArrayList();
        Set wrapperElementQNames = buildOperations(binding, serviceEndpointInterface, isLightweight, portInfo, exceptionMap, classLoader, operations);
        for (Iterator iter = operations.iterator(); iter.hasNext();) {
            OperationDesc operation = (OperationDesc) iter.next();
            serviceDesc.addOperationDesc(operation);
        }

        TypeMappingRegistryImpl tmr = new TypeMappingRegistryImpl();
        tmr.doRegisterFromVersion("1.3");

        TypeMapping typeMapping = tmr.getOrMakeTypeMapping(serviceDesc.getUse().getEncoding());

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

        List typeInfo;
        if (isLightweight) {
            LightweightTypeInfoBuilder builder = new LightweightTypeInfoBuilder(classLoader, schemaTypeKeyToSchemaTypeMap, wrapperElementQNames);
            typeInfo = builder.buildTypeInfo(portInfo.getJavaWsdlMapping());
        } else {
            HeavyweightTypeInfoBuilder builder = new HeavyweightTypeInfoBuilder(classLoader, schemaTypeKeyToSchemaTypeMap, wrapperElementQNames, operations, hasEncoded);
            typeInfo = builder.buildTypeInfo(portInfo.getJavaWsdlMapping());
        }

        // We register type mappings and invoke serviceDesc.getOperations to trigger an introspection of the
        // operations. By doing these operations during deployment, no introspection is required during runtime.
        TypeInfo.register(typeInfo, typeMapping);
        serviceDesc.getOperations();

        return new ReadOnlyServiceDesc(serviceDesc, typeInfo);
    }
View Full Code Here

Examples of org.apache.axis.description.JavaServiceDesc

    }

    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", new Class[] { 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, Collections.EMPTY_LIST);

        Class pojoClass = cl.loadClass("org.apache.geronimo.axis.testData.echosample.EchoBean");

        RPCProvider provider = new POJOProvider();
        SOAPService service = new SOAPService(null, provider, null);
        service.setServiceDescription(sd);
        service.setOption("className","org.apache.geronimo.axis.testData.echosample.EchoBean");
        URI wsdlURL = new URI("echo.wsdl");
        URI location = new URI(serviceDesc.getEndpointURL());
        Map wsdlMap = new HashMap();

        AxisWebServiceContainer container =
            new AxisWebServiceContainer(location, wsdlURL, service, wsdlMap, cl);
View Full Code Here

Examples of org.apache.axis.description.JavaServiceDesc


    public void configurePOJO(GBeanData targetGBean, JarFile moduleFile, Object portInfoObject, String seiClassName, ClassLoader classLoader) throws DeploymentException {
        PortInfo portInfo = (PortInfo) portInfoObject;
        ServiceInfo serviceInfo = AxisServiceBuilder.createServiceInfo(portInfo, classLoader);
        JavaServiceDesc serviceDesc = serviceInfo.getServiceDesc();

        try {
            classLoader.loadClass(seiClassName);
        } catch (ClassNotFoundException e) {
            throw new DeploymentException("Unable to load servlet class for pojo webservice: " + seiClassName, e);
        }

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

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

        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

Examples of org.apache.axis.description.JavaServiceDesc

    public void configureEJB(GBeanData targetGBean, JarFile moduleFile, Object portInfoObject, ClassLoader classLoader) throws DeploymentException {
        PortInfo portInfo = (PortInfo) portInfoObject;
        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);
    }
View Full Code Here

Examples of org.apache.axis.description.JavaServiceDesc

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

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

        final 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 (final JaxRpcOperationInfo operationInfo : serviceInfo.operations) {
            final OperationDesc operationDesc = buildOperationDesc(operationInfo, serviceEndpointInterface);
            serviceDesc.addOperationDesc(operationDesc);
        }

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

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

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

Examples of org.apache.axis.description.JavaServiceDesc

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

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

        // Create service
        final RPCProvider provider = new EjbRpcProvider(beanContext, createHandlerInfos(port.getHandlerChains()));
        final SOAPService service = new SOAPService(null, provider, null);
        service.setServiceDescription(serviceDesc);

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

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

Examples of org.apache.axis.description.JavaServiceDesc

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

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

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

Examples of org.apache.axis.description.JavaServiceDesc

    }

    public void testInvokeSOAP() throws Exception {

        final ClassLoader cl = Thread.currentThread().getContextClassLoader();
        final 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);

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

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

        final OperationDesc op = new OperationDesc();
        op.setName("echoString");
        op.setStyle(Style.RPC);
        op.setUse(Use.ENCODED);
        final Class beanClass = EchoBean.class;
        op.setMethod(beanClass.getMethod("echoString", String.class));
        final 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();
        final ReadOnlyServiceDesc sd = new ReadOnlyServiceDesc(serviceDesc);

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

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

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

        final InputStream in = cl.getResourceAsStream("echoString-req.txt");
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.