Package org.apache.tuscany.sca.binding.jsonrpc.protocol

Examples of org.apache.tuscany.sca.binding.jsonrpc.protocol.JsonRpc20Response


        }

        if (!responseMessage.isFault()) {
            if (jsonOperation.getOutputWrapper().getDataBinding().equals(JSONDataBinding.NAME)) {
                result = responseMessage.getBody();
                return new JsonRpc20Response((ObjectNode)JacksonHelper.MAPPER.readTree(result.toString()));
            } else {
                if (jsonOperation.getOutputType().getLogical().size() == 0) {
                    // void operation (json-rpc notification)
                    try {
                        JsonRpc20Response response = new JsonRpc20Response(request.getId(), null);
                        return response;
                    } catch (Exception e) {
                        throw new ServiceRuntimeException("Unable to create JSON response", e);
                    }

                } else {
                    // regular operation returning some value
                    try {
                        result = responseMessage.getBody();
                        JsonRpc20Response response = new JsonRpc20Response(request.getId(), (JsonNode)result);
                        //get response to send to client
                        return response;
                    } catch (Exception e) {
                        throw new ServiceRuntimeException("Unable to create JSON response", e);
                    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.jsonrpc.protocol.JsonRpc20Response

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.