Package org.apache.axis2.jaxws.description

Examples of org.apache.axis2.jaxws.description.OperationDescription


    protected MessageContext createRequest(Method method, Object[] args) throws Throwable {
        if (log.isDebugEnabled()) {
            log.debug("Creating a new Message using the request parameters.");
        }

        OperationDescription operationDesc =
                endpointDesc.getEndpointInterfaceDescription().getOperation(method);

        MessageContext request = new MessageContext();
       
        // Select a Classloader to use for marshaling
View Full Code Here


     * @param requestMessageCtx JAXWS Message Context containing the outbound Dispatch message
     * @return the OperationDescription corresponding to the operation contained in the Dispatch message, or null
     * if it can not be determined or if dispatch operation resolution is disabled via a property.
     */
    private OperationDescription getOperationDescriptionForDispatch(MessageContext requestMessageCtx) {
        OperationDescription operationDesc = null;
        if (dispatchOperationResolutionEnabled()) {
            EndpointInterfaceDescription endpointInterfaceDesc = getEndpointDescription().getEndpointInterfaceDescription();
            // The SEI interface could be null (for example if there was no SEI and all the ports were dynamically added).
            // If there is an SEI, then try to determine the operation for the outbound dispatch message.
            if (endpointInterfaceDesc != null) {
View Full Code Here

     *
     * @return The OperationDescription corresponding to the body element QName or null if one can not be found.
     */
    private OperationDescription determineOperationDescFromBodyElementQName(EndpointInterfaceDescription endpointInterfaceDesc,
                                                                            QName bodyElementQName) {
        OperationDescription operationDesc = null;
       
        // If there's no bodyElementQName for us to work with, there's nothing more we can do.
        if (bodyElementQName != null) {
            // This logic mimics the code in SOAPMessageBodyBasedOperationDispatcher.findOperation.  We will look for
            // the AxisOperation corresponding to the body element name.  Note that we are searching for the AxisOperation instead
            // of searching through the OperationDescriptions so that we can use the getOperationByMessageElementQName
            // for the Doc/Lit/Bare case.  Once we have the AxisOperation, we'll use that to find the Operation Description.
            AxisService axisService = endpointInterfaceDesc.getEndpointDescription().getAxisService();
            AxisOperation axisOperation = null;
   
            // Doc/Lit/Wrapped and RPC, the operation name is the first body element qname
            axisOperation = axisService.getOperation(new QName(bodyElementQName.getLocalPart()));
           
            if (axisOperation == null) {
                // Doc/Lit/Bare, the first body element qname is the element name contained in the wsdl:message part
                axisOperation = axisService.getOperationByMessageElementQName(bodyElementQName);
            }
           
            if (axisOperation == null) {
                // Not sure why we wouldn't have found the operation above using just the localPart rather than the full QName used here,
                // but this is what SOAPMessageBodyBasedOperationDispatcher.findOperation does.
                axisOperation = axisService.getOperation(bodyElementQName);
            }
   
            // If we found an axis operation, then find the operation description that corresponds to it
            if (axisOperation != null) {
                OperationDescription allOpDescs[] = endpointInterfaceDesc.getDispatchableOperations();
                for (OperationDescription checkOpDesc : allOpDescs ) {
                    AxisOperation checkAxisOperation = checkOpDesc.getAxisOperation();
                    if (checkAxisOperation == axisOperation) {
                        operationDesc = checkOpDesc;
                        break;
View Full Code Here

     *
     * @param ctx - The MessageContext for the request
     * @return A string with the calculated SOAPAction
     */
    public static String findSOAPAction(MessageContext ctx) {
        OperationDescription op = ctx.getOperationDescription();
        Boolean useSoapAction =
                (Boolean)ctx.getProperty(BindingProvider.SOAPACTION_USE_PROPERTY);
        if (useSoapAction != null && useSoapAction.booleanValue()) {
            // If SOAPAction use hasn't been disabled by the client, then first
            // look in the context properties.
            String action =
                    (String)ctx.getProperty(BindingProvider.SOAPACTION_URI_PROPERTY);
            if (action != null) {
                if (log.isDebugEnabled()) {
                    log.debug("Setting soap action from JAX-WS request context.  Action [" +
                            action + "]");
                }
                return action;
            }

            // If we didn't find anything in the context props, then we need to
            // check the OperationDescrition to see if one was configured in the WSDL.
            if (op != null) {
                action = op.getAction();
                if (action != null) {
                    if (log.isDebugEnabled()) {
                        log.debug("Setting soap action from operation description.  Action [" +
                                action + "]");
                    }
View Full Code Here

        // clients do not use operations, so the operationDesc will be null.  In this
        // case an anonymous AxisService with anonymous AxisOperations for the supported
        // MEPs will be created; and it is that anonymous operation name which needs to
        // be specified
        QName operationName = null;
        OperationDescription opDesc = requestMsgCtx.getOperationDescription();
        if (opDesc != null && opDesc.getAxisOperation() != null)
            operationName = opDesc.getName();
        else
            operationName = defaultOpName;
        return operationName;
    }
View Full Code Here

        // Per JSR-181 all methods on the SEI are mapped to operations regardless
        // of whether they include an @WebMethod annotation.  That annotation may
        // be present to customize the mapping, but is not required (p14)
        for (Method method : getSEIMethods(dbc.getCorrespondingClass())) {
            OperationDescription operation = new OperationDescriptionImpl(method, this);
            addOperation(operation);
        }
    }
View Full Code Here

        } catch (AxisFault e) {
            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("eiDescrImplErr"),e);
        }
       
        genericProviderAxisOp.setName(new QName(JAXWS_NOWSDL_PROVIDER_OPERATION_NAME));
        OperationDescription opDesc = new OperationDescriptionImpl(genericProviderAxisOp, this);
       
        addOperation(opDesc);
        AxisService axisService = getEndpointDescription().getAxisService();
        axisService.addOperation(genericProviderAxisOp);
    }
View Full Code Here

                AxisService axisService = getEndpointDescription().getAxisService();
                AxisOperation axisOperation = axisService
                        .getOperation(OperationDescriptionImpl.determineOperationQName(mdc));

                OperationDescription operation =
                        new OperationDescriptionImpl(mdc, this, axisOperation);

                if (axisOperation == null) {
                    // This axisOperation did not already exist on the AxisService, and so was created
                    // with the OperationDescription, so we need to add the operation to the service
                    ((OperationDescriptionImpl)operation).addToAxisService(axisService);
                }

                if (log.isDebugEnabled())
                    log.debug("EID: Just added operation= " + operation.getOperationName());
                addOperation(operation);
            }

        }
View Full Code Here

                    // which are defined on the SEI are not defined as operations in the WSDL.
                    // Although they usually specific the same OperationName as the WSDL operation,
                    // there may be cases where they do not.
                    // TODO: Is this path an error path, or can the async methods specify different operation names than the
                    //       WSDL operation?
                    OperationDescription operation = new OperationDescriptionImpl(seiMethod, this);
                    addOperation(operation);
                } else {
                    // Currently Axis2 does not support overloaded operations.  That means that even if the WSDL
                    // defined overloaded operations, there would still only be a single AxisOperation, and it
                    // would be the last operation encounterd.
                    // HOWEVER the generated JAX-WS async methods (see above) may (will always?) have the same
                    // operation name and so will come down this path; they need to be added.
                    // TODO: When Axis2 starts supporting overloaded operations, then this logic will need to be changed
                    // TODO: Should we verify that these are the async methods before adding them, and treat it as an error otherwise?

                    // Loop through all the opdescs; if one doesn't currently have a java method set, set it
                    // If all have java methods set, then add a new one.  Assume we'll need to add a new one.
                    boolean addOpDesc = true;
                    for (OperationDescription checkOpDesc : updateOpDesc) {
                        if (checkOpDesc.getSEIMethod() == null) {
                            // TODO: Should this be checking (somehow) that the signature matches?  Probably not an issue until overloaded WSDL ops are supported.
                           
                            //Make sure that this is not one of the 'async' methods associated with
                            //this operation. If it is, let it be created as its own opDesc.
                            if (!DescriptionUtils.isAsync(seiMethod)) {
                                ((OperationDescriptionImpl) checkOpDesc).setSEIMethod(seiMethod);
                                addOpDesc = false;
                                break;
                            }
                        }
                    }
                    if (addOpDesc) {
                        OperationDescription operation =
                                new OperationDescriptionImpl(seiMethod, this);
                        addOperation(operation);
                    }
                }
            }
View Full Code Here

        }
        return method;
    }
   
    private Method getServiceMethod(MessageContext mc) {
        OperationDescription opDesc = mc.getOperationDescription();
        if (opDesc == null) {
            throw ExceptionFactory.makeWebServiceException("Operation Description was not set");
        }

        Method returnMethod = opDesc.getMethodFromServiceImpl(this.serviceImplClass);
        if (returnMethod == null) {
            throw ExceptionFactory
                    .makeWebServiceException(Messages.getMessage("JavaBeanDispatcherErr1"));
        }
View Full Code Here

TOP

Related Classes of org.apache.axis2.jaxws.description.OperationDescription

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.