Run a HTTP server in MySQL to receive data from a client - c++

I want to insert a Json content from android cell phone (as client) into my MySQL database (in server). In order that, at first, I send this Json content from my client to my server which runs a HTTP server using Qt application in C++. Next in C++, I call a MySQL stored procedure to insert the received Json into my database. As we see, there is an interface in C++ (HTTP Server) which I'm going to omit it.
I want to know, is there an approach like running HTTP server in MySQL to handle the above process without a HTTP server in C++? (So I can send the Json content from my client to my MySQL database directly.)

No, the MYSQL server does not expose a JSON interface. You'd have to interact with the MSQL server directly using this. So no JSON, but direct SQL queries to your MYSQL server.
If you don't want to do that, a http webserver is not the only option, but it's probably the most sensible solution.

Related

Not able to connect Node.js/Socket.io Server from a Client using Websocket from a Unix System in a LAN

I have written a client application in C++ using websockets in Unix Environment trying to connect a Node.js/Socket.IO server running in a LAN connectivity. I found the server application is not responding at all. I tried a couple of other options from client side eventually getting no response from the server. Basically, i am trying to send a JSON object to the system running SocketIO server, but the client is not getting connected even if the server listens on to a Port.
Help, is really appreciated. Thank you.
Make sure following has been checked-
Server running and port is open (firewall) - Client is unable to connect the server
Url is correct - Client is unable to connect or url not exist
Listener code or receiving task is running - Client connected but when server send data to client, client didnot receive data
JSON format is correct and json data does not contain invalid character - client send data server but server did not received
Follow -
remove date if exists into msg for test purpose, use " to prepare JSON data, donot put / end of the url if not required. example-
1. Write url as ws://abc.com:8080/wsserver
2. JSON data as {"name":"myname","yourname":"indo","msg":"birthday"}

Server for Webservices

I am trying to develop webservices for a data collection server. I understand the restful services part of the schema, but what does the independent data collection server have to do differently to serve data to webservices? To be clear, "Data server - Webservices - third party client" is the overall schema. When a client requests data from webservices, how does it get it from the data server? HTTP request? Data server should send HTTP responses? Please explain.
You have 3 parties in the data exchange: Client, Web Service layer, and Data Server (Remote database). Generally speaking, the client would exchange the data by HTTP, or any other protocol. It is not strictly limited - but HTTP is the most frequent case. Next, you Web service layer would connect to the remote database. It all depends on your choice of technologies. Usually, you have specific classes to work with the remote databases such as JDBC Connection class for relational databases. When the client connects to your web service, the web service in turn calls the methods of classes, which connect to remote databases. How this happens is not the concern of the developer (it might be a binary protocol, or HTTP request - depends on the database) - you just have an API. When the response is returned to your classes, you transform it into some data format like XML, or JSON, and send it back to the client as an HTTP response, or with some other protocol.

Passing Server URL using Variable in Webserver connection manager

I m a newbie, learning SSIS. Currently I am trying to get data from webservice and import it to database table. When establishing the connection to the server. Is it possible to send it using variable instead of hardcoding it in HTTP connection manager Editior?
Right-click on the connection manager and select "Parametrize". The rest of it should be self-explanatory.

How to send frequent real-time server-side status update messages?

I have a web server that listens for jQuery keyboard events and I would like to send a string of the status for a set of keys to another domain for processing.
What technology/language/protocol is able to do this on the server-side?
It must be able to send the updated status message upon immediate change as listened for by keyboard events like arrow keys.
This is not a standard server <-> client updating but rather client > server > another server.
Can a WebSocket be used to create a server-side connection to a remote location, not a client?
https://en.wikipedia.org/wiki/WebSockets
What technology/language/protocol is able to do this on the server-side?
Any modern server side language can do it, node.js, c#, python, php. Just write your condition and make the request from your server as client.
Can a WebSocket be used to create a server-side connection to a remote location, not a client?
Of course! Your server can be a client like any other device. NodeJS example

Passing Data from Delphi Client to / from Web Service

If I create a web service in Delphi XE as CGI executable, what's the best way for it to return data to a client? Say the server uses ADO to access SQL server and the data is stored in a TADODataSet component - what's the best way to get it back to the client through a web service call? Do I need to convert it to XML and return it as a string and have the client recreate it?
With the DataSnap framework it is possible to send dataset between server and client(s).
See more here : can-delphi-2009-build-web-service-that-returns-a-dataset