Package org.apache.axis.description

Examples of org.apache.axis.description.ServiceDesc


    private void listServices(Iterator i, AxisStringWriter response)
    {
        response.write("<ul>");
        while (i.hasNext())
        {
            ServiceDesc sd = (ServiceDesc)i.next();
            StringBuffer sb = new StringBuffer(512);
            sb.append("<li>");
            String name = sd.getName();
            sb.append(name);
            sb.append(" <a href=\"");
            if (sd.getEndpointURL() != null)
            {
                sb.append(sd.getEndpointURL());
                if (!sd.getEndpointURL().endsWith("/"))
                {
                    sb.append("/");
                }
            }
            sb.append(name);
            sb.append("?wsdl\"><i>(wsdl)</i></a></li>");
            response.write(sb.toString());
            if (sd.getDocumentation() != null)
            {
                response.write("<ul><h6>" + sd.getDocumentation() + "</h6></ul>");
            }
            ArrayList operations = sd.getOperations();
            if (!operations.isEmpty())
            {
                response.write("<ul>");
                OperationDesc desc;
                for (Iterator it = operations.iterator(); it.hasNext();)
View Full Code Here


                  sb.append( "<h2>And now... Some Services</h2>\n" );
                  Iterator i = engine.getConfig(  ).getDeployedServices(  );
                  sb.append( "<ul>\n" );
                  while ( i.hasNext(  ) )
                  {
                     ServiceDesc sd = (ServiceDesc) i.next(  );
                     sb.append( "<li>\n" );
                     sb.append( sd.getName(  ) );
                     sb.append( " <a href=\"services/" );
                     sb.append( sd.getName(  ) );
                     sb.append( "?wsdl\"><i>(wsdl)</i></a></li>\n" );
                     ArrayList operations = sd.getOperations(  );
                     if ( !operations.isEmpty(  ) )
                     {
                        sb.append( "<ul>\n" );
                        for ( Iterator it = operations.iterator(  ); it.hasNext(  ); )
                        {
View Full Code Here

        // Obtain our possible operations
        if (operations == null) {
            SOAPService service    = msgContext.getService();
            if (service != null) {
                ServiceDesc serviceDesc = service.getInitializedServiceDesc(msgContext);

                String lc = Utils.xmlNameToJava(name);
                operations = serviceDesc.getOperationsByName(lc);
            }
        }

        if (operations != null && operations.length > 0) {
            // IF we're doc/literal... we can't count on the element name
View Full Code Here

            SimpleProvider provider = new SimpleProvider();
            server = new AxisServer(provider);
            transport = new LocalTransport(server);

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

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

            provider.deployService(SERVICE_NAME, service);
View Full Code Here

        SOAPService service = new SOAPService(new RPCProvider());
        service.setOption("className", "test.encoding.TestOmittedValues");
        service.setOption("allowedMethods", "*");

        ServiceDesc desc = service.getServiceDescription();
        // We need parameter descriptors to make sure we can match by name
        // (the only way omitted==null can work).
        ParameterDesc [] params = new ParameterDesc [] {
            new ParameterDesc(new QName("", "param1"), ParameterDesc.IN, null),
            new ParameterDesc(new QName("", "param2"), ParameterDesc.IN, null),
            new ParameterDesc(new QName("", "param3"), ParameterDesc.IN, null),
        };
        OperationDesc oper = new OperationDesc("method", params, null);
        desc.addOperationDesc(oper);
        config.deployService("testOmittedValue", service);

        String msg = header + missingParam2 + footer;
        Message message = new Message(msg);
        MessageContext context = new MessageContext(server);
View Full Code Here

     * @return Document
     * @throws Exception
     */
    public Document emit(int mode) throws Exception {
        if (serviceDesc == null) {
            serviceDesc = new ServiceDesc();
            serviceDesc.setImplClass(cls);
            //serviceDesc.setStyle();
            TypeMappingRegistry tmr = new TypeMappingRegistryImpl();
            serviceDesc.setTypeMapping((TypeMapping)tmr.getDefaultTypeMapping());
        }
View Full Code Here

            if (serviceHandler == null)
                return null;
        }

        ServiceDesc desc = serviceHandler.getInitializedServiceDesc(this);

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

        return possibleOperations;
    }
View Full Code Here

            log.debug(JavaUtils.getMessage("enter00",
                "RPCProvider.processMessage()"));
        }

        SOAPService service = msgContext.getService();
        ServiceDesc serviceDesc = service.getServiceDescription();
        OperationDesc operation = msgContext.getOperation();

        Vector          bodies = reqEnv.getBodyElements();
        if (log.isDebugEnabled()) {
            log.debug(JavaUtils.getMessage("bodyElems00", "" + bodies.size()));
            log.debug(JavaUtils.getMessage("bodyIs00", "" + bodies.get(0)));
        }

        /* Loop over each entry in the SOAPBody - each one is a different */
        /* RPC call.                                                      */
        /******************************************************************/
        for ( int bNum = 0 ; bNum < bodies.size() ; bNum++ ) {
            RPCElement   body;

            // If this is a regular old SOAPBodyElement, and it's a root,
            // we're probably a non-wrapped doc/lit service.  In this case,
            // we deserialize the element, and create an RPCElement "wrapper"
            // around it which points to the correct method.
            // FIXME : There should be a cleaner way to do this...
            if (!(bodies.get(bNum) instanceof RPCElement)) {
                SOAPBodyElement bodyEl = (SOAPBodyElement)bodies.get(bNum);
                // igors: better check if bodyEl.getID() != null
                // to make sure this loop does not step on SOAP-ENC objects
                // that follow the parameters! FIXME?
                if (bodyEl.isRoot() && operation != null) {
                    ParameterDesc param = operation.getParameter(bNum);
                    // at least do not step on non-existent parameters!
                    if(param != null) {
                        Object val = bodyEl.getValueAsType(param.getTypeQName());
                        body = new RPCElement("",
                                              operation.getName(),
                                              new Object [] { val });
                    }
                    else continue;
                } else {
                    continue;
                }
            } else {
                body = (RPCElement) bodies.get( bNum );
            }

            String methodName = body.getMethodName();
            Vector args = body.getParams();
            int numArgs = args.size();

            // This may have changed, so get it again...
            // FIXME (there should be a cleaner way to do this)
            operation = msgContext.getOperation();

            if (operation == null) {
                QName qname = new QName(body.getNamespaceURI(),
                                        body.getName());
                operation = serviceDesc.getOperationByElementQName(qname);
            }

            if (operation == null) {
                throw new AxisFault(JavaUtils.getMessage("noSuchOperation",
                                                         methodName));
View Full Code Here

            * configure this in the future.
            */
            rpc.setOption( "allowedMethods", "*");

            // Set up service description
            ServiceDesc sd = rpc.getServiceDescription();
            sd.setImplClass(cl.loadClass(clsName));
            sd.setTypeMapping(msgContext.getTypeMapping());

            // Set engine, which hooks up type mappings.
            rpc.setEngine(msgContext.getAxisEngine());
           
            rpc.init();   // ??
View Full Code Here

        // Register the reverseString service
        SOAPService reverse = new SOAPService(new RPCProvider());
        reverse.setOption("className", "test.RPCDispatch.Service");
        reverse.setOption("allowedMethods", "reverseString");
        provider.deployService(new QName(null,SOAPAction), reverse);
        ServiceDesc serviceDesc = reverse.getServiceDescription();
        serviceDesc.loadServiceDescByIntrospection(test.RPCDispatch.Service.class,
                                                   (TypeMapping)reverse.getTypeMappingRegistry().getDefaultTypeMapping());

        // invoke the service and verify the result
        assertEquals("Did not reverse the string correctly.", "cba", rpc("reverseString", new Object[] {"abc"}));
    }
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.