Package org.apache.axis2.jaxws.description

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


        // 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(this, mdc));
               
                OperationDescription operation =
                    new OperationDescriptionImpl(mdc, this, axisOperation);

                //1) if wsdl is defined then we should only expose operations that are in wsdl.
                //NOTE:If wsdl is defined AxisService will have all operations found in wsdl,
                //AxisServiceBuilder will do that part before metadata layer is invoked.
                //2) if wsdl not defined we need to expose operations based on annotation, in
                //which case we need add operations not found in AxisService.
                if(getWSDLDefinition() != null){
                    if(log.isDebugEnabled()){
                        log.debug("wsdl definition found, we will not expose operation not found in AxisService.");
                    }
                    if (log.isDebugEnabled())
                        log.debug("EID: Just added operation= " + operation.getOperationName());
                    addOperation(operation);
                    //Cater to partial wsdl case, if wsdl is found but AxisService was
                    //not built using this wsdl we need to add operation to AxisService.
                    if(!getEndpointDescriptionImpl().isWSDLFullySpecified()){
                        if(log.isDebugEnabled()){
                            log.debug("Partial wsdl definition found, we will add operation to the AxisService.");
                        }
                        ((OperationDescriptionImpl)operation).addToAxisService(axisService);
                    }
                }
                //Since wsdl is not defined add all operations to AxisService and OperationDescriptionList.
                else if(axisOperation == null) {
                    if(log.isDebugEnabled()){
                        log.debug("wsdl defintion NOT found, we will expose operation using annotations.");
                    }
                    // 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);
                }
                //This is the case where wsdl is not defined and AxisOperation is found in Axis Service.
                //Here we have to ensure that corresponding OperationDescription is added to OperationDescriptionList.
                else if(getWSDLDefinition()==null && axisOperation!=null){
                    if (log.isDebugEnabled())
                        log.debug("EID: Just added operation= " + operation.getOperationName());
                    addOperation(operation);
                }
            }
          
        }
View Full Code Here

                if (updateOpDesc == null || updateOpDesc.length == 0) {
                    // This operation wasn't defined in the WSDL.  Note that the JAX-WS async methods
                    // 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.
                    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

                    // 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

    public OperationDescription getOperation(String operationName) {
        if (DescriptionUtils.isEmpty(operationName)) {
            return null;
        }

        OperationDescription matchingOperation = null;
        for (OperationDescription operation : getOperations()) {
            if (operationName.equals(operation.getOperationName())) {
                matchingOperation = operation;
                break;
            }
View Full Code Here

     * @param seiMethod The java.lang.Method from the SEI for which an OperationDescription is
     *                  wanted
     * @return
     */
    public OperationDescription getOperation(Method seiMethod) {
        OperationDescription returnOperation = null;
        if (seiMethod != null) {
            OperationDescription[] allOperations = getOperations();
            for (OperationDescription operation : allOperations) {
                if (operation.getSEIMethod() != null && operation.getSEIMethod().equals(seiMethod))
                {
View Full Code Here

    public AxisOperation getAxisOperation() {
        // Note that only the sync operations, and not the JAX-WS async client versions of an
        // operation, will have an AxisOperation associated with it.  For those async operations,
        // get the AxisOperation associated with the sync method and return that.
        if (axisOperation == null) {
            OperationDescription opDesc = getSyncOperation();
            if (opDesc != null && opDesc != this) {
                return getSyncOperation().getAxisOperation();
            }
        }
       
View Full Code Here

            // The current OpDesc is not an async operation.  Cache it, then return it below.
            syncOperationDescription = this;
        } else {
            // We haven't found a sync opdesc for this operation yet, so try again.  See the
            // comments in the interface declaration for this method on why this might occur.
            OperationDescription opDesc = null;
           
            String webMethodAnnoName = getOperationName();
            String javaMethodName = getJavaMethodName();
            if (webMethodAnnoName != null && webMethodAnnoName.length() > 0 &&
                    webMethodAnnoName != javaMethodName) {
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

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.