Examples of WebParam


Examples of javax.jws.WebParam

        // Marshal parts of mode that should notbe ignored and are not part of
        // the SOAP Headers
        Object[] args = objCtx.getMessageObjects();
        for (int idx = 0; idx < noArgs; idx++) {
            WebParam param = callback.getWebParam(idx);
            if ((param.mode() != ignoreParamMode) && !param.header()) {
                Object partValue = args[idx];
                if (param.mode() != WebParam.Mode.IN) {
                    partValue = ((Holder)args[idx]).value;
                }

                QName elName = (callback.getSOAPStyle() == Style.DOCUMENT)
                                    ? new QName(param.targetNamespace(), param.name())
                                    : new QName("", param.partName());
                writer.write(partValue, elName, xmlNode);
            }
        }
    }
View Full Code Here

Examples of javax.jws.WebParam

        // Unmarshal parts of mode that should notbe ignored and are not part of
        // the SOAP Headers
        Object[] methodArgs = (Object[])objCtx.getMessageObjects();
        for (int idx = 0; idx < noArgs; idx++) {
            WebParam param = callback.getWebParam(idx);
            if ((param.mode() != ignoreParamMode) && param.header()) {
                QName elName = new QName(param.targetNamespace(), param.name());
                NodeList headerElems = header.getElementsByTagNameNS(elName.getNamespaceURI(), elName
                    .getLocalPart());
                assert headerElems.getLength() == 1;
                Node childNode = headerElems.item(0);

                Object obj = reader.read(elName, idx, childNode);
                if (param.mode() != WebParam.Mode.IN) {
                    try {
                        // TO avoid type safety warning the Holder
                        // needs tobe set as below.
                        methodArgs[idx].getClass().getField("value").set(methodArgs[idx], obj);
                    } catch (Exception ex) {
View Full Code Here

Examples of javax.jws.WebParam

        // Marshal parts of mode that should notbe ignored and are not part of
        // the SOAP Headers
        Object[] args = (Object[])objCtx.getMessageObjects();
        for (int idx = 0; idx < noArgs; idx++) {
            WebParam param = callback.getWebParam(idx);
            if ((param.mode() != ignoreParamMode) && param.header()) {
                SOAPHeader header = envelope.getHeader();
                wroteHeader = true;
                Object partValue = args[idx];
                if (param.mode() != WebParam.Mode.IN) {
                    partValue = ((Holder)args[idx]).value;
                }

                QName elName = new QName(param.targetNamespace(), param.name());
                writer.write(partValue, elName, header);

                addSOAPHeaderAttributes(header, elName, true);
            }
        }
View Full Code Here

Examples of javax.jws.WebParam

        }
        return sb;
    }

    public WebParam getWebParamAnnotation(Annotation[] pa) {
        WebParam wp = null;

        if (null != pa) {
            for (Annotation annotation : pa) {
                if (WebParam.class.equals(annotation.annotationType())) {
                    wp = (WebParam)annotation;
View Full Code Here

Examples of javax.jws.WebParam

            if (holder) {
                clazz = getHoldedClass(clazzType, parameterGenTypes[i]);
            }
            for (Annotation anno : paraAnns[i]) {
                if (anno.annotationType() == WebParam.class) {
                    WebParam webParam = (WebParam)anno;

                    if (!webParam.header()
                        && (webParam.mode() == WebParam.Mode.IN || webParam.mode() == WebParam.Mode.INOUT)) {
                        criteria1 = true;
                    }

                    if (!method.getReturnType().getName().equalsIgnoreCase("void") && !webParam.header()
                        && (webParam.mode() == WebParam.Mode.OUT || webParam.mode() == WebParam.Mode.INOUT)) {
                        criteria2 = false;

                    }

                    if (method.getReturnType().getName().equalsIgnoreCase("void") && !webParam.header()
                        && (webParam.mode() == WebParam.Mode.OUT || webParam.mode() == WebParam.Mode.INOUT)) {
                        nonHeaderParamCount++;
                    }

                    paraName = webParam.name().length() > 0 ? webParam.name() : paraName;
                    partName = webParam.partName().length() > 0 ? webParam.partName() : paraName;
                    paraTNS = webParam.targetNamespace().length() > 0
                        ? webParam.targetNamespace() : paraTNS;

                    QName requestQN = new QName(paraTNS, paraName);
                    TypeReference typeref = new TypeReference(requestQN, clazz, paraAnns[i]);
                    JavaParameter jp;
                    if (holder) {
                        if (webParam.mode() == WebParam.Mode.INOUT) {
                            jp = new JavaParameter(typeref.tagName.getLocalPart(), typeref,
                                                   JavaType.Style.INOUT);
                        } else {
                            jp = new JavaParameter(typeref.tagName.getLocalPart(), typeref,
                                                   JavaType.Style.OUT);
                        }
                    } else {
                        jp = new JavaParameter(typeref.tagName.getLocalPart(), typeref, JavaType.Style.IN);
                    }
                    jp.setName(paraName);
                    jp.setPartName(partName);
                    jp.setHeader(webParam.header());
                    jp.setTargetNamespace(paraTNS);
                    paras.add(jp);
                }
            }
            i++;
View Full Code Here

Examples of javax.jws.WebParam

        Annotation[][] anno = getPrivParameterAnnotations(method);
        int count = method.getParameterTypes().length;
        for (int i = 0; i < count; i++) {
            for (Annotation ann : anno[i]) {
                if (ann.annotationType() == WebParam.class) {
                    WebParam webParam = (WebParam)ann;
                    if (paraName.equals(webParam.name())) {
                        return webParam;
                    }
                }
            }
        }
View Full Code Here

Examples of javax.jws.WebParam

        Method method = clz.getMethod("testHeader4", new Class[] {java.lang.String.class,
                                                                  Holder.class});
        if (method == null) {
            fail("Missing method testHeader4 of TestHeader class!");
        }
        WebParam webParamAnno = AnnotationUtil.getWebParam(method, "testHeaderMessage");
        if (webParamAnno == null) {
            fail("Missing 'inoutHeader' WebParam Annotation of method testHeader4!");
        }
        assertEquals("INOUT", webParamAnno.mode().name());
        assertEquals(true, webParamAnno.header());
        assertEquals("inoutHeader", webParamAnno.partName());
    }
View Full Code Here

Examples of javax.jws.WebParam

            assertEquals(w1.partName(), w2.partName());
            assertEquals(w1.targetNamespace(), w2.targetNamespace());
        }
       
        for (int x = 0; x < c1.getParamsLength(); x++) {
            WebParam wp1 =  c1.getWebParam(x);
            WebParam wp2 =  c2.getWebParam(x);
            if (wp1 != null || wp2 != null) {
                assertNotNull(wp1);
                assertNotNull(wp2);
                assertEquals(wp1.name(), wp2.name());
                assertEquals(wp1.header(), wp2.header());
                assertEquals(wp1.partName(), wp2.partName());
                assertEquals(wp1.targetNamespace(), wp2.targetNamespace());
            }
        }
    }
View Full Code Here

Examples of javax.jws.WebParam

        assertEquals("responseType", webResultAnno.name());

        method = clz.getMethod("greetMe", new Class[] {String.class});
        assertEquals("String", method.getReturnType().getSimpleName());
        WebParam webParamAnn = AnnotationUtil.getWebParam(method, "requestType");
        assertEquals("http://objectweb.org/hello_world_soap_http/types", webParamAnn.targetNamespace());

        method = clz.getMethod("greetMeOneWay", new Class[] {String.class});
        Oneway oneWayAnn = AnnotationUtil.getPrivMethodAnnotation(method, Oneway.class);
        assertNotNull("OneWay Annotation is not generated", oneWayAnn);
        assertEquals("void", method.getReturnType().getSimpleName());
View Full Code Here

Examples of javax.jws.WebParam

        Class clz = classLoader.loadClass("org.objectweb.mapping.SomethingServer");
        Method method = clz.getMethod("doSomething", new Class[] {int.class, javax.xml.ws.Holder.class,
                                                                  javax.xml.ws.Holder.class});
        assertEquals("boolean", method.getReturnType().getSimpleName());
        WebParam webParamAnno = AnnotationUtil.getWebParam(method, "y");
        assertEquals("INOUT", webParamAnno.mode().name());
        webParamAnno = AnnotationUtil.getWebParam(method, "z");
        assertEquals("OUT", webParamAnno.mode().name());

    }
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.