What's new
Carbonite

South Africa's Top Online Tech Classifieds!
Register a free account today to become a member! (No Under 18's)
Home of C.U.D.

SOAP/XML/RPC/port/socket Say what???

wmdvanzyl

VIP
VIP Supporter
Rating - 100%
52   0   0
Joined
Aug 1, 2010
Messages
703
Reaction score
18
Points
3,415
Location
Paarl, Western Cape, South Africa
So i have a decent amount of experience in developing websites, but haven't needed to touch PHP (in a serious way... and also, on it's studio) for a while. I have a client that wants to send status data from a remote site to a website and be able to monitor it from there. I haven't touched networking protocols since varsity, so what is the status quo now? Where do i start? I was thinking just have the device (which runs C++) build an XML message and have it open a connection to my webserver and send the data through. But... i don't have experience in doing this.

So is it difficult? Any pointers? Libraries? Advice? Freelancers?

Appreciated.
 
How about making your sever a REST server and just doing POST and GET requests from the remote PC. You can probably use something like Spring (Don't know the C# equivalent) or you can use Javelin (Written in Kotlin/Java, but use kotlin, its awesome!) which is an easy way to setup a server using Rest or Sockets (in newer versions I believe).

How often will data be uploaded? If you need to keep data updated all the time and there is a constant stream of data I would suggest using web sockets, otherwise Rest should be fine.
 
REST or MQQT or some form of SQL would be my initial guess.
Volume? Security? Quantity? Hardware? These are all the questions that need to be answered.
 
If you can get a good REST Service up and running it can be extremely powerful and easy to use and modify.
 
If you super lazy, you can wysiwyg your way through it with something like node-red

Has built in 'nodes' for most rpc protocols. REST is standard.
 
Thanks for responses.

How about making your sever a REST server and just doing POST and GET requests from the remote PC. You can probably use something like Spring (Don't know the C# equivalent) or you can use Javelin (Written in Kotlin/Java, but use kotlin, its awesome!) which is an easy way to setup a server using Rest or Sockets (in newer versions I believe).

How often will data be uploaded? If you need to keep data updated all the time and there is a constant stream of data I would suggest using web sockets, otherwise Rest should be fine.

So what you are saying is the solution is at server level. I set up a REST server and have the connecting device (haven't seen the hardware yet, but i know it can run C++) connect via POST requests? How do i then bring that data into my website? Can i write the data directly into the database and read from there? I was originally thinking along the lines of XML. I will definitely check out those links and projects. Thx! Data is uploaded from every device once every 30 minutes, but i don't know how many devices yet, so it could become many...


REST or MQQT or some form of SQL would be my initial guess.
Volume? Security? Quantity? Hardware? These are all the questions that need to be answered.

Volume could vary between 10 or so devices doing posts every 30 minutes to potentially hundreds. Security isn't a main concern right now as they are just reporting on basic stuff such operating variables. Simple integer values. There is no control invovled. I suppose if someone goes to the effort of intercepting it and spoofing the numbers it could cause a problem, but what would be their gain? Best practice would be to encrypt everything from the start and just avoid the whole issue. Agree that those questions need to be answered.

If you can get a good REST Service up and running it can be extremely powerful and easy to use and modify.
If i can get it up? Is it difficult?

If you super lazy, you can wysiwyg your way through it with something like node-red

Has built in 'nodes' for most rpc protocols. REST is standard.

Never heard of it. Got a good link? Or shall i google that myself? :p
 
REST or MQQT or some form of SQL would be my initial guess.
Volume? Security? Quantity? Hardware? These are all the questions that need to be answered.

+1. Used to be a big REST fan until I started playing with MQQT. REST should be easier to implement out of the box. But your constraints like security, frequency and available bandwidth are the deciding factors. I don't bother with SOAP unless I expose the API to third parties
 
Last edited:
+1. Used to be a big REST fan until I started playing with MQQT. REST should be easier to implement out of the box. But your constraints like security, frequency and available bandwidth are the deciding factors. I don't bother with SOAP unless I expose the API.

Have any good resource to help me get started setting up REST server?
 
REST is so simple you can literally do a request via a Telnet session. Would be shap for you C++ client.
 
What framework/stack is your server running?

I haven't decided yet. Project just landed on my desk today. I was just going to build the front-end, but i wanted to check out whether it would be something i am capable of figuring out (love learning new stuff) or whether i need to outsource it. So i am free to use whatever stack i please. Seeing that this might scale quite drastically, i am considering going AWS, but even that isn't set in stone yet.
 
Thanks for responses.
So what you are saying is the solution is at server level. I set up a REST server and have the connecting device (haven't seen the hardware yet, but i know it can run C++) connect via POST requests? How do i then bring that data into my website? Can i write the data directly into the database and read from there? I was originally thinking along the lines of XML. I will definitely check out those links and projects. Thx! Data is uploaded from every device once every 30 minutes, but i don't know how many devices yet, so it could become many...

The nice thing about a REST server is that its super expandable and easy to use. The remote device will post data to your server and your website will do basic get requests to fetch the data from your server. The server can probably use push notifications to let the website know that data changes have happened. The other nice thing about using REST is that you can easily setup mobile devices to use it as most mobile device libraries have built in support for it.

With Javelin setting up Auth is easy-ish and took me a few hours to figure out. You will add the authentication details into the headers of your post request so your basic flow will be remote device POST(data) and then website GET(data). You will attach the auth headers to each request.

I personally don't like XML and would rather use JSON. I have seen a lot more crappy designed XML based payloads than JSON payloads.
 
Most important question: What OS is on the device hardware?
You keep talking about the devices connecting to the server.
If you are running something like a ESP8266 microcontroller with TCP stack, obviously you would rather go fro something like MQQT. If your hardware is something like a Raspberry Pi, MQQT or REST is good, mySQL might be an option.
If it is something more powerful like a PC, anything is viable.
 

Users who are viewing this thread

Latest posts

Back
Top Bottom