GithubHelp home page GithubHelp logo

json-rpc's People

Contributors

ritwiksaikia avatar

Watchers

James Cloos avatar

json-rpc's Issues

Reponse parsing fails if error "data" field value is json

What steps will reproduce the problem?
1. execute request
2. get the reponse 
"{"result":null,"error":{"code":-32002,"message":"service.invalid-parameters","d
ata":{"email":["'email' is no valid email address in the basic format 
local-part@hostname"]}},"id":"1890594141"}"
3. catch UnsupportedOperationException

JsonRpcInvoker.java, line 108:
String data = (o.has("data") ? o.get("data").getAsString() : null);

if "data" is json, o is JsonObject, which throws UnsupportedOperationException
 on getAsString();

You should check where o is JsonObject and return obj.toString() if true.

Original issue reported on code.google.com by [email protected] on 24 May 2011 at 11:44

** WARN ** (JsonRpcExecutor:118) unable to parse json-rpc request java.lang.ClassCastException: com.google.gson.JsonNull cannot be cast to com.google.gson.JsonObject

What steps will reproduce the problem?
1. Either (async or sync) AJAX call or Java invoke to JsonRPC Jetty servlet

What is the expected output? What do you see instead?
Normal response, but get ClassCastException from Servlet, possibly due to 
EOFException in javacc parser?

What version of the product are you using? On what operating system?
jsonrpc-1.0.jar on jetty-6.1.24.jar DefaultServlet

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 20 Jan 2012 at 10:58

Using different locale produces a java.text.ParseException

What steps will reproduce the problem?
1. Start a Jsonrpc service on a server using locale x
2. Call a method on the server with a javaclient using locale y that has 
serialized java.util.Date


What is the expected output? What do you see instead?
Instead of a  value from server 


What version of the product are you using? On what operating system?
I'm running 1.0 version of json-rpc in a jetty8 servlet container running on 
linux debian. 
Clients are Java Apps running on multiple platforms. 


Please provide any additional information below.
A quick fix is of course to make sure you have the same Locale on both server 
and client. I can see a need to have clients on different Locales. I'm not sure 
if this is a gson issu as it's gson that seems to encode/decode the Date object 
to Json using the default locale pattern.   


Original issue reported on code.google.com by [email protected] on 31 Jan 2012 at 3:40

Just a typo in documentation

Hi,

fyi, there is a small typo in the usage documentation. Where it says

executor.add("calc", calcImpl, Calculator.class);

it should say

executor.addHandler("calc", calcImpl, Calculator.class);

Original issue reported on code.google.com by [email protected] on 18 Oct 2011 at 5:39

Data Objects

Is there any possibility of my methods return a class created by me? 
Eg: 
class Student {...} 

public Student getStudent () //Return a student object

Thanks in advance

Original issue reported on code.google.com by [email protected] on 19 Oct 2012 at 9:55

Better support for HTTP basic auth

Basically, just set the proper header (Base64.js needed: 
http://www.webtoolkit.info/javascript-base64.html):

--- a/lib/jsonrpc.js
+++ b/lib/jsonrpc.js
@@ -178,7 +178,10 @@ JsonRpc.ServiceProxy.prototype.__callMethod = 
function(methodName, params, succe
                 xhr = new ActiveXObject('Microsoft.XMLHTTP');
             }
         }
-        xhr.open('POST', this.__serviceURL, this.__isAsynchronous, 
this.__authUsername, this.__authPassword);
+        xhr.open('POST', this.__serviceURL, this.__isAsynchronous);
+        if(this.__authUsername != null && this.__authPassword != null){
+            xhr.setRequestHeader('Authorization', "Basic 
"+Base64.encode(this.__authUsername+":"+this.__authPassword));
+        }
         xhr.setRequestHeader('Content-Type', 'application/json');
         xhr.setRequestHeader('Accept', 'application/json');

Original issue reported on code.google.com by desfrenes on 25 Mar 2012 at 8:34

Attachments:

i hava a question.

i saw that sentences..

not allow list or map ....

is it true?

could i use list or map?  (return value)


Original issue reported on code.google.com by [email protected] on 15 May 2011 at 7:34

JsonRpcClientException No Solution!

What steps will reproduce the problem?
1. The communication with the server is established 
(HttpJsonRpcClientTransport(new URL(url));)
2. The invoker is obtained with success (calc = invoker.get(...))
3. The problem is here, when i call the method calc.add(1, 2) it gives me a 
JsonRpcClientException: unable to get data from transport. I can not find a 
reason for it.

What is the expected output? What do you see instead?
The output is the sum of 1 + 2. It gives me an exception

What version of the product are you using? On what operating system?
MacOs X, Android Simulator and RPC Server are Jboss AS.


Original issue reported on code.google.com by [email protected] on 4 Oct 2012 at 11:27

Inconsistent POM file for jsonrpc artifact 1.0

What steps will reproduce the problem?
1. Using Grails 1.3.7 and Eclipse, set up BuildConfig.groovy with maven config 
for org.json.rpc:jsonrpc:1.0, repo http://json-rpc.googlecode.com/svn/mavenrepo
2. Refresh dependencies from eclipse


What is the expected output? What do you see instead?
I believe the POM file for artifact jsonrpc is broken; the error message I see 
is: org.json.rpc#jsonrpc;1.0: java.text.ParseException: inconsistent module 
descriptor file found in 
'http://json-rpc.googlecode.com/svn/mavenrepo/org/json/rpc/jsonrpc/1.0/jsonrpc-1
.0.pom': bad revision: expected='1.0' found='1.0-SNAPSHOT';

What version of the product are you using? On what operating system?
Windows 7, jsonrpc 1.0

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 27 Feb 2012 at 3:00

Enhancement: HTTP session in Java Client for security

First thanks and congratulations for providing such a well designed RPC 
framework.

What I found outstanding:
1)
   JsonRpcExecutor#addHandler(String name, ..). This provides a level of security and convenience, i.e. it does not expose the server class name. A very positive effect is that server side re-factoring does not break client implementations.
2) 
   A Java client is provided, which allows for unit testing of server code, and evaluation.

Back o the point.

With RPC, there is often a security aspect, authenticatiion. Most robust 
authentication on the internet is token based.

The the following discussion "json-rpc authentication?"
http://groups.google.com/group/json-rpc/browse_thread/thread/3cde3ada0e3dc8bf

mentions "authentication on transport-level" which is the background of this 
issue.

To implement such authentication, the java client code needs access to session 
cookies.

On the server side, such support would also be desirable, but this is not so 
critical because unlike with the client code, server session support can be 
implemented without changing any RPC framework code.

Original issue reported on code.google.com by [email protected] on 24 Jan 2012 at 8:39

Support Serializing of Checked Exceptions

If a handler interface includes a method that throws a checked Exception then 
it would be useful that the exception is serialized and re-thrown in the Java 
client so that its attributes can be used as with any other object.

A typical use case would be a NotAuthorizedException or NotLoggedInException

Currently one could use one of the fields in 
org.json.rpc.commons.JsonRpcRemoteException e.g. data which contains the stack 
trace.

However sending a server stack trace to the client can cause problems whether 
from a checked or unchecked exception, so it might be useful to remove this 
information anyway and instead refer to the server log.

May be GWT could be useful for some ideas:
http://code.google.com/webtoolkit/doc/1.5/tutorial/RPC.html



Original issue reported on code.google.com by [email protected] on 11 Feb 2012 at 9:17

Circular Reference if Custom Type is used more than once

As a workaround for issue 8 
http://code.google.com/p/json-rpc/issues/detail?id=8 I use a custom data type 
that does not have locale issues:

public class SimpleDate implements Serializable{
    private int year;
    private int month;
    private int day;
    ...
}

I use this in another top level return type:

public class Result implements Serializable{
    private SimpleDate date1;
    private SimpleDate date2;    
    ...
}

With this code, I get an exception:

    at org.json.rpc.commons.GsonTypeChecker.isValidType(GsonTypeChecker.java:106)
    at org.json.rpc.commons.GsonTypeChecker.isValidType(GsonTypeChecker.java:128)
    at org.json.rpc.commons.GsonTypeChecker.isValidType(GsonTypeChecker.java:30)
    at org.json.rpc.commons.TypeChecker.isValidMethod(TypeChecker.java:44)
    at org.json.rpc.commons.TypeChecker.isValidInterface(TypeChecker.java:99)
    at org.json.rpc.server.HandleEntry.<init>(HandleEntry.java:53)
    at org.json.rpc.server.JsonRpcExecutor.addHandler(JsonRpcExecutor.java:81)
    at com.mycompany.JsonRpcServlet.bind(JsonRpcServlet.java:25)
    at com.mycompany.JsonRpcServlet.<init>(JsonRpcServlet.java:18)

Original issue reported on code.google.com by [email protected] on 14 Mar 2013 at 10:11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.