0
I Use This!
Very Low Activity
Analyzed about 21 hours ago. based on code collected 2 days ago.

Project Summary

jsonrpc4j - JSON-RPC for JavaThis project aims to provide the facility to easily implement JSON-RPC for the java programming language. At the heart of jsonrpc4j is JsonEngine. JsonEngine is used to convert java objects to and from json objects (and other things related to JSON-RPC). JsonEngine is an interface and therefore makes the underlying JSON implementation pluggable. Currently the only implementation available uses Jackson (JacksonJsonEngine).

What's Missing?Here's a list of things that need to be implemented:

GET support as per the spec (currently only POST is supported) Create portable javascript library

MavenThis project is built with Maven. Be sure to check the pom.xml for the dependencies if you're not using maven. If you're already using spring you should have most (if not all) of the dependencies already - outside of maybe the Jackson library. The jsonrpc4j maven repository is located at http://jsonrpc4j.googlecode.com/svn/maven/repo/. Add the following to your pom.xml if you're using maven:

In :


jsonrpc4j-webdav-maven-repo
jsonrpc4j maven repository
http://jsonrpc4j.googlecode.com/svn/maven/repo/
default
In :


com.googlecode
jsonrpc4j
0.1-SNAPSHOT
JSON-RPC specificationThere doesn't seem to be an official source for the JSON-RPC specification. With that said, the guys over at json-rpc google group seem to be fairly active so the specification that they've outlined is what was used.

Spring Frameworkjsonrpc4j provides a RemoteExporter to expose java services as JSON-RPC over HTTP without requiring any additional work on the part of the programmer. The following example explains how to use the JsonServiceExporter within the Spring Framework.

Create your service interface:

package com.mycompany;
public interface UserService {
User createUser(String userName, String firstName, String password);
User createUser(String userName, String password);
User findUserByUserName(String userName);
int getUserCount();
}Implement it:

package com.mycompany;
public class UserServiceImpl
implements UserService {

public User createUser(String userName, String firstName, String password) {
User user = new User();
user.setUserName(userName);
user.setFirstName(firstName);
user.setPassword(password);
database.saveUser(user)
return user;
}

public User createUser(String userName, String password) {
return this.createUser(userName, null, password);
}

public User findUserByUserName(String userName) {
return database.findUserByUserName(userName);
}

public int getUserCount() {
return database.getUserCount();
}

}Configure your service in spring as you would any other RemoteExporter:






Your service is now available at the URL /UserService.json. Type conversion of JSON->Java and Java->JSON will happen for you automatically. This service can be accessed by any JSON-RPC capable client, including the JsonProxyFactoryBean provided by this project:






In the case that your JSON-RPC requies named based parameters rather than indexed parameters an annotation can be added to your service interface (this also works on the service implementation for the ServiceExporter):

package com.mycompany;
public interface UserService {
User createUser(@JsonRpcParamName("theUserName") String userName, @JsonRpcParamName("thePassword") String password);
}

Tags

http java javascript json jsonrpc jsonrpc4j remoting rpc spring

Badges

MIT License
Permitted

Commercial Use

Modify

Distribute

Sub-License

Private Use

Forbidden

Hold Liable

Required

Include Copyright

Include License

These details are provided for information only. No information here is legal advice and should not be used as such.

Project Security

Vulnerabilities per Version ( last 10 releases )

There are no reported vulnerabilities

Project Vulnerability Report

Security Confidence Index

Poor security track-record
Favorable security track-record

Vulnerability Exposure Index

Many reported vulnerabilities
Few reported vulnerabilities

Did You Know...

  • ...
    nearly 1 in 3 companies have no process for identifying, tracking, or remediating known open source vulnerabilities
  • ...
    data presented on the Open Hub is available through our API
  • ...
    in 2016, 47% of companies did not have formal process in place to track OS code
  • ...
    by exploring contributors within projects, you can view details on every commit they have made to that project
About Project Security

Languages

Java
99%
2 Other
1%

30 Day Summary

Feb 25 2024 — Mar 26 2024

12 Month Summary

Mar 26 2023 — Mar 26 2024
  • 15 Commits
    Down -2 (11%) from previous 12 months
  • 3 Contributors
    Down -1 (25%) from previous 12 months