Package com.leansoft.mwsc.model.annotation

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


        }
        return soapBindingAnnotation;
    }
   
    private WebParamAnnotation getWebParamAnnotation(Operation operation, JavaParameter javaParameter) {
      WebParamAnnotation webParamAnnotation = new WebParamAnnotation();
     
        Parameter param = javaParameter.getParameter();
        Request req = operation.getRequest();
        Response res = operation.getResponse();

        boolean header = isHeaderParam(param, req) ||
            (res != null && isHeaderParam(param, res));

        String name;
        boolean isWrapped = operation.isWrapped();

        if((param.getBlock().getLocation() == Block.HEADER) || (isDocStyle && !isWrapped))
            name = param.getBlock().getName().getLocalPart();
        else
            name = param.getName();

        webParamAnnotation.setName(name);

        String ns= null;

        if (isDocStyle) {
            ns = param.getBlock().getName().getNamespaceURI(); // its bare nsuri
            if(isWrapped){
                ns = param.getType().getName().getNamespaceURI();
            }
        }else if(header){
            ns = param.getBlock().getName().getNamespaceURI();
        }

        if((ns != null) && (!ns.equals(serviceNS) || (isDocStyle && isWrapped)))
            webParamAnnotation.setTargetNamespace(ns);

        if (header) {
            webParamAnnotation.setHeader(true);
        }

        if (param.isINOUT()){
            webParamAnnotation.setMode("javax.jws.WebParam.Mode.INOUT");
        }else if ((res != null) && (isMessageParam(param, res) || isHeaderParam(param, res) || isAttachmentParam(param, res) ||
                isUnboundParam(param,res) || param.isOUT())){
            webParamAnnotation.setMode("javax.jws.WebParam.Mode.OUT");
        }

        //doclit wrapped could have additional headers
        if(!(isDocStyle && isWrapped) || header)
          webParamAnnotation.setPartName(javaParameter.getParameter().getName());
       
        return webParamAnnotation;
    }
View Full Code Here

TOP

Related Classes of com.leansoft.mwsc.model.annotation.WebParamAnnotation

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.