Examples of OperationDesc


Examples of org.apache.axis.description.OperationDesc

                                SOAPEnvelope resEnv,
                                Object obj)
        throws Exception
    {
        Handler targetService = msgContext.getService();
        OperationDesc operation = msgContext.getOperation();
        Method method = operation.getMethod();

        // is this service a body-only service?
        // if true, we expect to pass a Vector of body Elements (as DOM) and
        //   get back an array of DOM Elements for the return body, OR
        //   to pass a Document and get back a Document.
View Full Code Here

Examples of org.apache.axis.description.OperationDesc

            log.debug("Enter: 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)));
        }

        RPCElement   body = null;

        // Find the first "root" body element, which is the RPC call.
        for ( int bNum = 0 ; body == null && bNum < bodies.size() ; bNum++ ) {
            // 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 && bodyEl.getID() == 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 {
                body = (RPCElement) bodies.get( bNum );
            }
        }

       // special case code for a document style operation with no
       // arguments (which is a strange thing to have, but whatever)
        if (body == null) {
            // throw an error if this isn't a document style service
            if (!serviceDesc.getStyle().equals(Style.DOCUMENT)) {
                throw new Exception(JavaUtils.getMessage("noBody00"));
            }

            // look for a method in the service that has no arguments,
            // use the first one we find.
            ArrayList ops = serviceDesc.getOperations();
            for (Iterator iterator = ops.iterator(); iterator.hasNext();) {
                OperationDesc desc = (OperationDesc) iterator.next();
                if (desc.getNumInParams() == 0) {
                    // found one with no parameters, use it
                    msgContext.setOperation(desc);
                    // create an empty element
                    body = new RPCElement(desc.getName());
                    // stop looking
                    break;
                }
            }
View Full Code Here

Examples of org.apache.axis.description.OperationDesc

            // find the right one.  For each matching operation which has an
            // equal number of "in" parameters, try deserializing.  If we
            // don't succeed for any of the candidates, punt.

            for (int i = 0; i < operations.length; i++) {
                OperationDesc operation = operations[i];
                if (operation.getNumInParams() >= numParams ||
                    elementIsFirstParam ||
                    operation.getStyle() == Style.WRAPPED) {
                    // If the Style is WRAPPED, the numParams may be inflated
                    // as in the following case:
                    //  <getAttractions xmlns="urn:CityBBB">
                    //      <attname>Christmas</attname>
                    //      <attname>Xmas</attname>
                    //   </getAttractions>
                    //
                    //  for getAttractions(String[] attName)
                    //
                    // numParams will be 2 and and operation.getNumInParams=1

                    // Set the operation so the RPCHandler can get at it
                    rpcHandler.setOperation(operation);
                    try {
                        if (elementIsFirstParam && operation.getNumInParams() > 0) {
                            context.pushElementHandler(rpcHandler);
                            context.setCurElement(null);
                        } else {
                            context.pushElementHandler(
                                    new EnvelopeHandler(rpcHandler));
View Full Code Here

Examples of org.apache.axis.description.OperationDesc

                        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();) {
                                OperationDesc desc = (OperationDesc) it.next();
                                sb.append("<li>" + desc.getName());
                            }
                            sb.append("</ul>\n");
                        }
                    }
                    sb.append("</ul>\n");
View Full Code Here

Examples of org.apache.axis.description.OperationDesc

            SchemaTypeKey key = (SchemaTypeKey) iter.next();
            qNameToKey.put(key.getqName(), key);
        }

        for (Iterator iter = operations.iterator(); iter.hasNext();) {
            OperationDesc operationDesc = (OperationDesc) iter.next();
            ArrayList parameters = new ArrayList(operationDesc.getParameters());
            ParameterDesc returnParameterDesc = operationDesc.getReturnParamDesc();
            if (null != returnParameterDesc.getTypeQName() &&
                    false == returnParameterDesc.getTypeQName().equals(XMLType.AXIS_VOID)) {
                parameters.add(returnParameterDesc);
            }
            for (Iterator iterator = parameters.iterator(); iterator.hasNext();) {
View Full Code Here

Examples of org.apache.axis.description.OperationDesc

//        }

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

        TypeMappingRegistryImpl tmr = new TypeMappingRegistryImpl();
        tmr.doRegisterFromVersion("1.3");
View Full Code Here

Examples of org.apache.axis.description.OperationDesc

            SchemaTypeKey key = (SchemaTypeKey) iter.next();
            qNameToKey.put(key.getqName(), key);
        }

        for (Iterator iter = operations.iterator(); iter.hasNext();) {
            OperationDesc operationDesc = (OperationDesc) iter.next();
            ArrayList parameters = new ArrayList(operationDesc.getParameters());
            ParameterDesc returnParameterDesc = operationDesc.getReturnParamDesc();
            if (null != returnParameterDesc.getTypeQName() &&
                    false == returnParameterDesc.getTypeQName().equals(XMLType.AXIS_VOID)) {
                parameters.add(returnParameterDesc);
            }
            for (Iterator iterator = parameters.iterator(); iterator.hasNext();) {
View Full Code Here

Examples of org.apache.axis.description.OperationDesc

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

Examples of org.apache.axis.description.OperationDesc

                     if ( !operations.isEmpty(  ) )
                     {
                        sb.append( "<ul>\n" );
                        for ( Iterator it = operations.iterator(  ); it.hasNext(  ); )
                        {
                           OperationDesc desc = (OperationDesc) it.next(  );
                           sb.append( "<li>" + desc.getName(  ) );
                        }

                        sb.append( "</ul>\n" );
                     }
                  }
View Full Code Here

Examples of org.apache.axis.description.OperationDesc

    }

    public void processMessage(MessageContext msgContext, SOAPEnvelope reqEnv, SOAPEnvelope resEnv, Object obj) throws Exception {

        RPCElement body = getBody(reqEnv, msgContext);
        OperationDesc operation = getOperationDesc(msgContext, body);

        AxisRpcInterceptor interceptor = new AxisRpcInterceptor(operation, msgContext);
        SOAPMessage message = msgContext.getMessage();

        try {
            message.getSOAPPart().getEnvelope();
            msgContext.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, Boolean.FALSE);

            RpcContainer container = (RpcContainer) ejbDeployment.getContainer();

            Object[] arguments = {msgContext, interceptor};

            Class callInterface = ejbDeployment.getServiceEndpointInterface();
            Object result = container.invoke(ejbDeployment.getDeploymentID(), callInterface, operation.getMethod(), arguments, null);

            interceptor.createResult(result);
        } catch (InvalidateReferenceException e) {
            interceptor.createExceptionResult(e.getCause());
        } catch (ApplicationException e) {
            interceptor.createExceptionResult(e.getCause());
        } catch (Throwable throwable) {
            throw new AxisFault("Web Service EJB Invocation failed: method " + operation.getMethod(), throwable);
        }
    }
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.