Package javax.xml.ws

Examples of javax.xml.ws.ResponseWrapper


    private Object buildPayloadFromResponse() {
        Method m = (Method)msgContext.get(ObjectMessageContext.METHOD_OBJ);
        // TODO -- add support for 'out' params
        //
        if (!Void.TYPE.equals(m.getReturnType())) {
            ResponseWrapper ann = m.getAnnotation(ResponseWrapper.class);
            assert ann != null : "ResponseWrapper is null";
            WebResult wr = m.getAnnotation(WebResult.class);
            assert wr != null : "WebResult is null for method " + m;

            Object returnVal = msgContext.get(ObjectMessageContext.METHOD_RETURN);
           
            // if a handler has aborted the processing sequence, the
            // return type may be null
            if (returnVal != null) {
                Object wrapper = createWrapperInstance(ann.className());
                setWrapperValue(wrapper, wr.name(), returnVal);
                return wrapper;
            }
        }
        return null;
View Full Code Here


    private boolean isRequestPayload(Object payload) {
       
        Method m = getMethod();

        RequestWrapper reqWrapper = m.getAnnotation(RequestWrapper.class);
        ResponseWrapper respWrapper = m.getAnnotation(ResponseWrapper.class);
       
        if (reqWrapper != null) {
            return payload.getClass().getName().equals(reqWrapper.className());
        } else if (respWrapper != null) {
            return !payload.getClass().getName().equals(respWrapper.className());
        }
        return true;
    }
View Full Code Here

                    Class cls = Class.forName(reqWrapper.className(), false,
                                        loader);
                    addClass(cls, classes);
                }
                //Get the RequestWrapper
                ResponseWrapper respWrapper = meth.getAnnotation(ResponseWrapper.class);
                if (respWrapper != null) {
                    Class cls = Class.forName(respWrapper.className(),
                                              false,
                                              loader);
                    addClass(cls, classes);
                }
            } catch (ClassNotFoundException ex) {
View Full Code Here

                                           wmAnnotation.operationName(),
                                           false);
                    }
                       
                } else {
                    ResponseWrapper responseWrapper =
                        method.getAnnotation(ResponseWrapper.class);
                    if (responseWrapper != null) {
                        action = getAction(responseWrapper.targetNamespace(),
                                           method,
                                           responseWrapper.localName(),
                                          false);
                    } else {
                       //RPC-Literal case.
                        WebService wsAnnotation = method.getDeclaringClass().getAnnotation(WebService.class);
                        WebMethod wmAnnotation = method.getAnnotation(WebMethod.class);
View Full Code Here

        javaMethod.addRequest(request);

        WSDLParameter response = null;
        if (!isOneWayMethod(method)) {
            // process response
            ResponseWrapper resWrapper = method.getAnnotation(ResponseWrapper.class);
            String resClassName = "";
            // rule 3.5 suffix -"Response"
            String resName = method.getName() + "Response";
            String resNS = model.getTargetNameSpace();
            if (resWrapper != null) {
                resClassName = resWrapper.className();
                resName = resWrapper.localName().length() > 0 ? resWrapper.localName() : resName;
                resNS = resWrapper.targetNamespace().length() > 0 ? resWrapper.targetNamespace() : resNS;
            } else {
                resClassName = model.getPackageName() + ".types."
                    + AnnotationUtil.capitalize(method.getName())
                               + "Response";
            }
View Full Code Here

                                                                                  RequestWrapper.class);

        assertEquals("org.apache.cxf.w2j.hello_world_soap12_http.types.SayHi",
                     requestWrapperAnn.className());

        ResponseWrapper resposneWrapperAnn = AnnotationUtil.getPrivMethodAnnotation(method,
                                                                                    ResponseWrapper.class);

        assertEquals("sayHiResponse", resposneWrapperAnn.localName());

        WebResult webResultAnno = AnnotationUtil.getPrivMethodAnnotation(method, WebResult.class);

        assertEquals("responseType", webResultAnno.name());
View Full Code Here

        RequestWrapper requestWrapperAnn = AnnotationUtil.getPrivMethodAnnotation(method,
                                                                                  RequestWrapper.class);

        assertEquals("org.apache.cxf.w2j.hello_world_soap_http.types.SayHi", requestWrapperAnn.className());

        ResponseWrapper resposneWrapperAnn = AnnotationUtil.getPrivMethodAnnotation(method,
                                                                                    ResponseWrapper.class);

        assertEquals("sayHiResponse", resposneWrapperAnn.localName());

        WebResult webResultAnno = AnnotationUtil.getPrivMethodAnnotation(method, WebResult.class);

        assertEquals("responseType", webResultAnno.name());
View Full Code Here

     * @param mdc    - <code>MethodDescriptionComposite</code>
     * @param method - <code>Method</code>
     */
    private void attachResponseWrapperAnnotation(MethodDescriptionComposite mdc, Method
            method) {
        ResponseWrapper responseWrapper = (ResponseWrapper)ConverterUtils.getAnnotation(
                ResponseWrapper.class, method);
        if (responseWrapper != null) {
            ResponseWrapperAnnot rwAnnot = ResponseWrapperAnnot.createResponseWrapperAnnotImpl();
            rwAnnot.setClassName(responseWrapper.className());
            rwAnnot.setLocalName(responseWrapper.localName());
            rwAnnot.setTargetNamespace(responseWrapper.targetNamespace());
            mdc.setResponseWrapperAnnot(rwAnnot);
        }
    }
View Full Code Here

    @Override
    public String getResponseWrapperPartName(OperationInfo op, Method method) {
        method = getDeclaredMethod(method);
        WebResult webResult = getWebResult(method);
        ResponseWrapper rw = method.getAnnotation(ResponseWrapper.class);
        if (rw != null) {
            String pn = getWithReflection(ResponseWrapper.class, rw, "partName");
            if (pn != null) {
                return pn;
            }
View Full Code Here

   
   
    @Override
    public QName getResponseWrapperName(OperationInfo op, Method method) {
        Method m = getDeclaredMethod(method);
        ResponseWrapper rw = m.getAnnotation(ResponseWrapper.class);
        String nm = null;
        String lp = null;
        if (rw != null) {
            nm = rw.targetNamespace();
            lp = rw.localName();
        }
        WebMethod meth = m.getAnnotation(WebMethod.class);
        if (meth != null && StringUtils.isEmpty(lp)) {
            lp = meth.operationName();
            if (!StringUtils.isEmpty(lp)) {
View Full Code Here

TOP

Related Classes of javax.xml.ws.ResponseWrapper

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.