Examples of WebResultAnnotation


Examples of com.leansoft.mwsc.model.annotation.WebResultAnnotation

       
        return webMethodAnn;
    }
   
    private WebResultAnnotation getWebResultAnnotation(Operation operation) {
      WebResultAnnotation webResultAnno = null;
     
        Block block;
        String resultName = null;
        String nsURI = null;
        if (operation.getResponse().getBodyBlocks().hasNext()) {
            block = operation.getResponse().getBodyBlocks().next();
            resultName = block.getName().getLocalPart();
            if(isDocStyle || block.getLocation() == Block.HEADER){
                nsURI = block.getName().getNamespaceURI();
            }
        }

        for (Parameter parameter : operation.getResponse().getParametersList()) {
            if (parameter.getParameterIndex() == -1) {
                if(operation.isWrapped()||!isDocStyle){
                    if(parameter.getBlock().getLocation() == Block.HEADER){
                        resultName = parameter.getBlock().getName().getLocalPart();
                    }else{
                        resultName = parameter.getName();
                    }
                    if (isDocStyle || (parameter.getBlock().getLocation() == Block.HEADER)) {
                        nsURI = parameter.getType().getName().getNamespaceURI();
                    }
                }else if(isDocStyle){
                    JAXBType t = (JAXBType)parameter.getType();
                    resultName = t.getName().getLocalPart();
                    nsURI = t.getName().getNamespaceURI();
                }

                if(!resultName.equals("return")){
                  webResultAnno = new WebResultAnnotation();
                    webResultAnno.setName(resultName);
                }
                if((nsURI != null) && (!nsURI.equals(serviceNS) || (isDocStyle && operation.isWrapped()))){
                    if(webResultAnno == null)
                      webResultAnno = new WebResultAnnotation();
                    webResultAnno.setTargetNamespace(nsURI);
                }
                //doclit wrapped could have additional headers
                if(!(isDocStyle && operation.isWrapped()) ||
                        (parameter.getBlock().getLocation() == Block.HEADER)){
                    if(webResultAnno == null)
                      webResultAnno = new WebResultAnnotation();
                    webResultAnno.setPartName(parameter.getName());
                }
                if(parameter.getBlock().getLocation() == Block.HEADER){
                    if(webResultAnno == null)
                      webResultAnno = new WebResultAnnotation();
                    webResultAnno.setHeader(true);
                }
            }

        }
       
View Full Code Here

Examples of org.apache.axis2.jsr181.WebResultAnnotation

                String partQname = methodName + RESPONSE;
                methodSchemaType =
                        createSchemaTypeForMethodPart(partQname);
                sequence = new XmlSchemaSequence();
                methodSchemaType.setParticle(sequence);
                WebResultAnnotation returnAnnon = JSR181Helper.INSTANCE.getWebResultAnnotation(jMethod);
                String returnName = "return";
                if (returnAnnon != null) {
                    returnName = returnAnnon.getName();
                    if (returnName == null || "".equals(returnName)) {
                        returnName = "return";
                    }
                }
                Type genericParameterType = jMethod.getGenericReturnType();
View Full Code Here

Examples of org.apache.axis2.jsr181.WebResultAnnotation

                String partQname = methodName + RESPONSE;
                methodSchemaType =
                        createSchemaTypeForMethodPart(partQname);
                sequence = new XmlSchemaSequence();
                methodSchemaType.setParticle(sequence);
                WebResultAnnotation returnAnnon = JSR181Helper.INSTANCE.getWebResultAnnotation(jMethod);
                String returnName = "return";
                if (returnAnnon != null) {
                    returnName = returnAnnon.getName();
                    if (returnName != null && !"".equals(returnName)) {
                        returnName = "return";
                    }
                }
                Type genericParameterType = jMethod.getGenericReturnType();
View Full Code Here

Examples of org.apache.axis2.jsr181.WebResultAnnotation

                if (returnType.isArray()) {
                    methodSchemaType =
                            createSchemaTypeForMethodPart(jMethod.getName() + RESULT);
                    sequence = new XmlSchemaSequence();
                    methodSchemaType.setParticle(sequence);
                    WebResultAnnotation returnAnnon = JSR181Helper.INSTANCE.getWebResultAnnotation(jMethod);
                    String returnName = "return";
                    if (returnAnnon != null) {
                        returnName = returnAnnon.getName();
                        if (returnName != null && !"".equals(returnName)) {
                            returnName = "return";
                        }
                    }
                    if (nonRpcMethods.contains(methodName)) {
View Full Code Here

Examples of org.apache.axis2.jsr181.WebResultAnnotation

                String partQname = methodName + RESPONSE;
                methodSchemaType =
                        createSchemaTypeForMethodPart(partQname);
                sequence = new XmlSchemaSequence();
                methodSchemaType.setParticle(sequence);
                WebResultAnnotation returnAnnon = JSR181Helper.INSTANCE.getWebResultAnnotation(jMethod);
                String returnName = "return";
                if (returnAnnon != null) {
                    returnName = returnAnnon.getName();
                    if (returnName != null && !"".equals(returnName)) {
                        returnName = "return";
                    }
                }
                Type genericParameterType = jMethod.getGenericReturnType();
View Full Code Here

Examples of org.codehaus.xfire.annotations.WebResultAnnotation

    {
        Annotation[][] annotations = method.getParameterAnnotations();
        WebResult webResult = (WebResult) method.getAnnotation(WebResult.class);
        if (webResult != null)
        {
            WebResultAnnotation annot = new WebResultAnnotation();
            annot.setName(webResult.name());
            annot.setTargetNamespace(webResult.targetNamespace());
            annot.setHeader(webResult.header());
            annot.setPartName(webResult.partName());
           
            return annot;
        }
        else
        {
View Full Code Here

Examples of org.codehaus.xfire.annotations.WebResultAnnotation

    }

    public void testGetWebResultAnnotation()
            throws Exception
    {
        WebResultAnnotation webResult = webAnnotations.getWebResultAnnotation(echoMethod);
        assertNotNull(webResult);
        assertEquals("echoResult", webResult.getName());
    }
View Full Code Here

Examples of org.codehaus.xfire.annotations.WebResultAnnotation

    }

    public void testGetNullWebResultAnnotation()
            throws Exception
    {
        WebResultAnnotation webResult = webAnnotations.getWebResultAnnotation(dummyMethod);
        assertNull(webResult);
    }
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.