Package org.apache.axis2.jaxws.marshaller

Examples of org.apache.axis2.jaxws.marshaller.MethodMarshaller


    }

    public static MethodMarshaller getMarshaller(OperationDescription op, boolean isClient,
                                                 ClassLoader cl) {

        MethodMarshaller marshaller = null;
        if (op.getSoapBindingStyle() == SOAPBinding.Style.DOCUMENT) {
            marshaller = createDocLitMethodMarshaller(op, isClient, cl);
        } else if (op.getSoapBindingStyle() == SOAPBinding.Style.RPC) {
            marshaller = createRPCLitMethodMarshaller(isClient);
        }
View Full Code Here


        assertNotNull(operationResult);
       
        //Verify OneWay Method is not minimal when there is a request wrapper       
        OperationDescription oneWayOperation = endpointInterfaceDescription.getOperation("oneWayVoid");
       
        MethodMarshaller methodMarshaller = MethodMarshallerFactory.getMarshaller(oneWayOperation, false);
      
        assertEquals("Method Marshaller class is incorrect for oneWay Doc/Lit/Wrapped operation", DocLitWrappedMethodMarshaller.class, methodMarshaller.getClass());
       
        // Verify a non-SEI method returns a null
        operationResult = endpointInterfaceDescription.getOperation(this.getClass().getMethods()[0]);
        assertNull(operationResult);
    }
View Full Code Here

   
    private Object[] createRequestParameters(MessageContext request) {
        // Get the appropriate MethodMarshaller for the WSDL type.  This will reflect
        // the "style" and "use" of the WSDL.
        Protocol requestProtocol = request.getMessage().getProtocol();
        MethodMarshaller methodMarshaller =
                getMethodMarshaller(requestProtocol, request.getOperationDescription(),
                                    request);
       
        // The MethodMarshaller will return the input parameters that are needed to
        // invoke the target method.
        Object[] methodInputParams =
                methodMarshaller.demarshalRequest(request.getMessage(), request.getOperationDescription());
       
        if (log.isDebugEnabled()) {
            log.debug("Unmarshalled parameters for request");
            if (methodInputParams != null) {
                log.debug(methodInputParams.length + " parameters were found.");   
View Full Code Here

        OperationDescription operationDesc = request.getOperationDescription();
        Method method = operationDesc.getMethodFromServiceImpl(serviceImplClass);
       
        // Create the appropriate response message, using the protocol from the
        // request message.
        MethodMarshaller marshaller = getMethodMarshaller(p, request.getOperationDescription(),
                                                          request);
        Message m = null;
        if (method.getReturnType().getName().equals("void")) {
            m = marshaller.marshalResponse(null, params, operationDesc, p);
        } else {
            m = marshaller.marshalResponse(output, params, operationDesc, p);
        }
       
        // We'll need a MessageContext configured based on the response.
        MessageContext response = MessageContextUtils.createResponseMessageContext(request);
        response.setMessage(m);
View Full Code Here

        Throwable faultMessage = InvocationHelper.determineMappedException(t, request);
        if(faultMessage != null) {
            t = faultMessage;
        }
       
        MethodMarshaller marshaller = getMethodMarshaller(p, request.getOperationDescription(),
                                                          request);
       
        Message m = marshaller.marshalFaultResponse(t, request.getOperationDescription(), p);
       
        MessageContext response = MessageContextUtils.createFaultMessageContext(request);
        response.setMessage(m);

        AxisFault axisFault = new AxisFault("The endpoint returned a fault when invoking the target operation.",
View Full Code Here

        return null;
    }

    public static MethodMarshaller getMarshaller(OperationDescription op, boolean isClient) {

        MethodMarshaller marshaller = null;
        if (isClient) {
            if (op.getSoapBindingStyle() == SOAPBinding.Style.DOCUMENT) {
                marshaller = createDocLitMethodMarshaller(op, isClient);
            } else if (op.getSoapBindingStyle() == SOAPBinding.Style.RPC) {
                marshaller = createRPCLitMethodMarshaller(isClient);
View Full Code Here

        OperationDescription operationDesc =
                getOperationDescription(mc); //mc.getOperationDescription();
        //Set SOAP Operation Related properties in SOAPMessageContext.
        ContextUtils.addWSDLProperties(mc);
        Protocol requestProtocol = mc.getMessage().getProtocol();
        MethodMarshaller methodMarshaller =
                getMethodMarshaller(mc.getMessage().getProtocol(), mc.getOperationDescription());
        Object[] methodInputParams =
                methodMarshaller.demarshalRequest(mc.getMessage(), mc.getOperationDescription());
        Method target = getJavaMethod(mc, serviceImplClass);
        if (log.isDebugEnabled()) {
            // At this point, the OpDesc includes everything we know, including the actual method
            // on the service impl we will delegate to; it was set by getJavaMethod(...) above.
            log.debug("JavaBeanDispatcher about to invoke using OperationDesc: " +
                    operationDesc.toString());
        }

        //At this point, we have the method that is going to be invoked and
        //the parameter data to invoke it with, so we use the instance and
        //do the invoke.
        //Passing method input params to grab holder values, if any.
        boolean faultThrown = false;
        Throwable fault = null;
        Object response = null;
        try {
            response = target.invoke(serviceInstance, methodInputParams);
        } catch (Exception e) {
            faultThrown = true;
            fault = e;
            if (log.isDebugEnabled()) {
                log.debug("Exception invoking a method of " +
                        serviceImplClass.toString() + " of instance " +
                        serviceInstance.toString());
                log.debug("Exception type thrown: " + e.getClass().getName());
                log.debug("Method = " + target.toGenericString());
                for (int i = 0; i < methodInputParams.length; i++) {
                    String value = (methodInputParams[i] == null) ? "null" :
                            methodInputParams[i].getClass().toString();
                    log.debug(" Argument[" + i + "] is " + value);
                }
            }
        }

        Message message = null;
        if (operationDesc.isOneWay()) {
            // If the operation is one-way, then we can just return null because
            // we cannot create a MessageContext for one-way responses.
            return null;
        } else if (faultThrown) {
            message = methodMarshaller.marshalFaultResponse(fault, mc.getOperationDescription(),
                                                            requestProtocol); // Send the response using the same protocol as the request
        } else if (target.getReturnType().getName().equals("void")) {
            message = methodMarshaller
                    .marshalResponse(null, methodInputParams, mc.getOperationDescription(),
                                     requestProtocol); // Send the response using the same protocol as the request
        } else {
            message = methodMarshaller
                    .marshalResponse(response, methodInputParams, mc.getOperationDescription(),
                                     requestProtocol); // Send the response using the same protocol as the request
        }

        MessageContext responseMsgCtx = null;
View Full Code Here

            String charSetEncoding = BuilderUtil.getCharSetEncoding(contentTypeStr);
            msgContext.setProperty(
                    Constants.Configuration.CHARACTER_SET_ENCODING, charSetEncoding);
            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);
                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    if (HTTPTransportUtils.isRESTRequest(contentTypeStr)) {
                        RESTUtil.processPOSTRequest(msgContext, is, os,
                                request.getRequestLine().getUri(), contentType, builder, isRestDispatching);
                    } else {
View Full Code Here

            String contentTypeStr = contentType != null ?
                    contentType.getValue() : inferContentType();

            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);

                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    RESTUtil.processGetAndDeleteRequest(
                            msgContext, os, request.getRequestLine().getUri(),
                            request.getFirstHeader(HTTP.CONTENT_TYPE), builder,
                            method, isRestDispatching);
                }
View Full Code Here

        params = getListenerParameters();


        param = transportIn.getParameter(NhttpConstants.ENDPOINTS_CONFIGURATION);
        if (param != null && param.getValue() != null) {
            endpoints = new URLEndpointsConfigurationFactory().create(param.getValue().toString());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.jaxws.marshaller.MethodMarshaller

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.