I want to add a very basic HTTP functionality to a .NET Core application. I want something similar to Akka HTTP Server.
Basically, I want something that allows me to accept a request containing a JSON array and respond with a JSON back.
Can anyone suggest a library, Nuget package or similar that I can use? I don't want ASP.NET MVC or other heavy frameworks. All tutorials that I could find are not targeted towards service to service communication.
You need to use one of web server implementations in ASP.NET Core
Kestrel
WebListener
or implement your own (OWIN based).
Related
Webservices like REST, SOAP which provides services which is made available for web application, as we know it can receives values as JSON, string, XML etc either by POST or GET and in the same way it can return data as JSON, string, XML etc.
The same thing can be done via servlet, as servlet can receive data as string, JSON etc either by POST or GET and in the same way it can return data as JSON, string, XML etc.
We need libraries based upon the web service we use, such as SOAP or REST, servlet libraries are almost in-built int it.
So whats the difference between Servlet and Web Services? Which one is more faster?
Can anyone please tell me some solution for this.
This is the kind of discussion that can lead to a lot of flame wars on semantics, but I would say web services are simply a method of communication utilizing standards to allow different technologies to be interoperable. Like an English-speaker translating between a French- and German-speaker.
Meanwhile, the way to implement web service endpoints (the places that serve responses to your requests) in a Java web server is with servlets. So servlets are simply a technology for implementing web service communication (in the JVM).
When you look at JAX-WS and JAX-RS, the frameworks that implement these standards are simply creating abstractions on top of Java's HttpServlet (typically) to make SOAP and REST web services easier to build by taking care of a lot of the low-level details.
Hope that helps.
where are a lot of difference between servlets and web services, but the main is:
in the web development servlets is the front end object and work in the web container, Web services can have different roles: as backend or as middle layer object.
The AllegroGraph RDF Store provides multiple channels to communicate through. I am developing a Web Service for that. I have the following questions:
How to implement a Web Service over this SPARQL Endpoint?
What are the best practices? CXF or Axis?
The link you provided points to the AllegroGraph API documentation. The documentation says:
The protocol described here is compatible (is a super-set of) with the Sesame 2.0 HTTP protocol and the W3C SPARQL protocol (SPARQL endpoint).
I think you may want to develop a small library that sits between AllegroGraph and the client applications and 'speaks' this protocol, which appears to be a combination of "normal" REST and SPARQL. A client application can then pass the arguments to your library, which translates them to arguments in a SPARQL query or normal REST request.
For these operations, you may be able to use one of the tools mentioned in this answer, or use an SPARQL API like Jena ARQ and a general REST API like JAX-RS, or similar functions in programming language of your project.
Depending on your project, you can integrate these functions (SPARQL and REST calls) with the client application. You could of course provide the services again as a web service (using e.g. CXF or Axis), but if you control the client application(s) this may be too much for your project.
I have a set of embedded devices that run software written in c++. The API to communicate the devices is simple: get/set/acquire parameters and signals.
I'd like to implement common web application to access all of the devices from a single point.
My idea was to add XML RPC interface to devices and then use ActiveResource to access devices from the web server. This combination doesn't seem to be used at all in practice.
I'm free to choose any protocol inside the devices. What are your recommendations?
If you're already considering XML RPC I'm assuming you have some sort of web server running on the device. I would probably choose a RESTful web service over XML RPC. If designed carefully you could have corresponding services on your Rails app.
For example:
http://somedevice/signals.json - gets all signals
http://yourrailsapp/somedevice/signals.json - gets somedevice's signals; you could use an id instead here if that makes more sense (http://yourrailsapp/devices/1/signals.json).
You probably won't find much XML RPC stuff in the Rails community. Rails itself really pushes you towards RESTful web services. Specifically a resource-oriented RESTful architecture. There are great books out there about it but it comes down to using http methods (get, put, post, delete) instead of passing parameters and then some intelligent URLS.
I have a C++ web service that needs to send/receive data from a Silverlight client.
Can I still use the WCF RIA client or do I need to use the sockets library directly?
Note that I'm pretty flexible on using HTTP or not, and I even prefer not to use the HTTP protocol.
Now this is just me thinking outloud here. But I'd assume that since you're using a C++ web service you're too low level to be doing anything WCF based (as WCF is usually a C# thing).
As far as using a sockets library directly, I think that a silverlight app can't do that for security reasons. Sockets are mainly for a client app that you have built yourself. But silverlight is a web client, So I would think that you'd only be left to use http requests.
I am implementing SOAP web services for a commercial application, and I am using GroovyWS to speed up the development.
But, when I deploy it on Tomcat, I am not using Grails, as the software has it's own J2EE framework, so how I do I get it to react to wsdl requests?
Do I need to write a groovy-based servlet?
Ideally I would like the WSDL generated upon request, so I can easily change the interface and see the change.
It seems I will miss the annotations that JAX-WS provides for, though, to help fine-tune the WSDL.
Using the example web application, the WSDL can be retrieved as follows:
http://localhost:6980/MathService?wsdl