Different Between rpc (remote procedure call) and webservices - json

I wanna know the basic different between rpc and webservices. which should be prefer.
I wanna choose between json-rpc and jax-ws.

Web service:
Web services are typically application programming interfaces (API) or Web APIs that are accessed via Hypertext Transfer Protocol (HTTP) and executed on a remote system hosting the requested services. Web services tend to fall into one of two camps: big Web services and RESTful Web services.
RPC:
Remote Procedure Calls. It enables a system to make calls to programs such as NFS across the network transparently, enabling each system to interpret the calls as if they were local. In this case, it would make exported filesystems appear as thought they were local.
Which one is preferable:
RPC would be used only for internal/in-house servers where you have influence on both the client and server code. The most frequent case is to forward services which only exist on a few machines. For example, to minimize the number of licenses or support overhead needed by forwarding requests to a central machine, or to provide access to software that is other operating system specific (eg, Linux programs that need to use an old program only available on SGIs.) The other case is to reduce startup costs.
We can identify two major classes of Web services, REST-compliant Web services, in which the primary purpose of the service is to manipulate XML representations of Web resources using a uniform set of "stateless" operations; and arbitrary Web services, in which the service may expose an arbitrary set of operations
May it will be helpful to you...

Related

Advice on approach to accessing MYSQL database from mobile app

Quick bit of advice if i may. I'm a startup company and developing a new mobile app that i intend to query and update data from a cloud MYSQL database, using a restful webservice and JSON. I am pretty new to this, but ok on the theory.
I originally thought i could use Dropbox to host the database and somehow install a Tomcat server also, to act as the http server, but i cant find anything online that says this is achievable. I've now found a temporary site heliohost.org, which offers free hosting, so i'm looking into that.
Does anyone have advice on a [low cost] longer term production cloud service for MYSQL database? And am i right that a good approach is to create a restful webservice in Eclipse and then somehow deploy that to the Tomcat server in the cloud, so that my app can then issue calls to it via the CN1 available methods.
There is quite a lot out there and much of it is self-promoting their own sites so was after some independent advice please.
Many thanks in advance.
You can't host and access an SQL server over the network from a device as access is remarkably unreliable and insecure. You will need some form of hosting. I used Linode for our online course since they are very affordable (5USD per month) but I've used AWS, Digital Ocean and others. They are all good.
You are correct that you will need to create a webservice, I used tomcat in the past but for the latest course I chose SpingBoot which is easier and more modern.
Using a mobile backend to store and retrieve data is a vast topic to discuss where different tools and services can be leveraged based on your application use cases.
However directly accessing MySQL server from your mobile client wouldn't be a recommended approach both in term of security as well as performance at scale.
Few options you can consider.
Developing the mobile backend with Amazon Mobile Hub where you can find different architectures and services. For example.
Using AWS DynamoDB as a Mobile Backend tightly controlling access permissions with AWS Cognito and DynamoDB Fine Grained Access Control.
Using Cognito Sync as a storage medium to Synchronize data from Mobile App to AWS and then using triggers to share and push data & etc.
Developing a REST API for the mobile backend using AWS Services such as API Gateway, Lambda & DynamoDB(Or Relational Databases like MySQL, Postgres SQL & etc. with RDS)

Implementing SSL in Java Based Web Applications

I have a java based web application developed in Amazon EC2. It is doing transactions of confidential information. I have a MySQL server installed all by my self in the same amazon instance. The web application access the database via localhost. In Security Groups, I have created a custom security where the port 8080 (the Tomcat) can be accessed only via localhost.
Considering these, do I still need SSL to make sure the transactions are secured?
It depends. Are you comfortable with plain text inside the datacenter? Don't bother with SSL.
Are you worried about that traffic being sniffed locally (tcpdump) or from a malicious source (for instance, if data was being rerouted from the switch between EC2 instances)? Use SSL.
There's a trend of large companies making sure to encrypt local traffic.

difference between application server and utility server

Guys I am looking for a lay man definition for Application server and Utility server and what eaxctly we do with them, why they are important and what role do they play. Please give me an example to understand them better
Most of the times these terms Web Server and Application server are used interchangeably.
Following are some of the key differences in features of Web Server and Application Server:
Web Server is designed to serve HTTP Content. App Server can also serve HTTP Content but is not limited to just HTTP. It can be provided other protocol support such as RMI/RPC
Web Server is mostly designed to serve static content, though most Web Servers have plugins to support scripting languages like Perl, PHP, ASP, JSP etc. through which these servers can generate dynamic HTTP content.
Most of the application servers have Web Server as integral part of them, that means App Server can do whatever Web Server is capable of. Additionally App Server have components and features to support Application level services such as Connection Pooling, Object Pooling, Transaction Support, Messaging services etc.
As web servers are well suited for static content and app servers for dynamic content, most of the production environments have web server acting as reverse proxy to app server. That means while servicing a page request, static contents (such as images/Static HTML) are served by web server that interprets the request. Using some kind of filtering technique (mostly extension of requested resource) web server identifies dynamic content request and transparently forwards to app server
Example of such configuration is Apache Tomcat HTTP Server and Oracle (formerly BEA) WebLogic Server. Apache Tomcat HTTP Server is Web Server and Oracle WebLogic is Application Server.
In some cases the servers are tightly integrated such as IIS and .NET Runtime. IIS is web server. When equipped with .NET runtime environment, IIS is capable of providing application services.
answer comes from "Rutesh Makhijani" in this question : link

How to automatically detect a server?

We have developed a client app and a server app. The client communicates with the server using the http protocol and sends some data to be processed by the server.
Our structure allow us to have the server installed anywhere. I can be on the same client network or even on the cloud.
When the server is hosted on the cloud, it makes sense asking the user for the server address (since it can change if the user wishes to) but it does not make sense when the server is on the same network that the client. Besides that, we are currently asking users to configure the server ip/name in order to connect to the server.
To avoid this (asking users for the address) I have developed a discovery service based on UDP. The client broadcasts a message that the server answer with its address. It does work on some cases, but it does not when the user has some kind of firewall, proxy or even an anti virus.
I have read a lot about discovery services, and the one that a like most is Bonjour.
So, the question is: what is the best way of discovering a server's IP when the server is on the same network that the client without being blocked by firewalls, proxies, etc?
You can keep your service purely local (in the intranet) and build on top of what you are using now by implementing hole punching. You can get past firewalls, but Im really not sure about AV software policies.
Or you can establish a well-known http-based discovery service in the internet.
A server comes alive, sends its (local) ip address to the discovery service (keeps sending keep-alives)
On startup, the client queries that discovery service, identifies the local subnet he is in, and gets back the local ip address of the server.
That of course creates a single point of failure in your system in that if the discovery service kicks the bucket, your clients cannot find servers. You can remedy that by replicating the service and/or introducing fallback mechanisms (like the purely local discovery you have), which you probably want to do anyway. The only problem you might have is the subnet identification, if computers in local subnets dont share external IP addresses (then it depends on what a local subnet is for you).

tcp socket server to test html5websocket

Which is best tcp socket server to testing html5websocket? I developing a html5socket based client that will interact with tcp. So I want first a testing server. I am good in PHP but not in sockets programming. So I used PHPwebsocket downloaded from google code. I tried it using its own client and server for testing but it suddenly disconnects and not work as intended so is there any other socket server to test HTML5 websocket client? Which one is better, I can use a python based, or java based tcp server or if in PHP then that can be more convenient. And please tell me what else I need to test HTML5 websocket. I am newbie in sockets. So my concepts are not so clear.
thanks for any advise.
If you want to self host then:
pywebsocket - Python
jwebsocket - Java
jetty with WebSockets - Java
You could connect to the Pusher hosted WebSocket API to see if you can connect. More information on the endpoints and Pusher protocol here:
http://pusher.com/docs/pusher_protocol
You would need to sign up for a free Pusher sandbox account to do this though.
You say you want to "interact with tcp". Do you have specific protocols in mind? If using JMS, XMPP, or AMQP, the Kaazing WebSocket Gateway provides these industry standard APIs and protocols in the browser out-of-the-box. For example, using JMS, you can build pretty complex messaging applications without a single line of server-side code. Everything can run in the client (typically in JavaScript in the browser).
Here are some examples showcasing the power of extending rich business protocols all the way to the browser.
Also, the Kaazing gateway comes with free development license; fully functional server for up to 50 concurrent connections, no functionality or time restrictions.