Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have a server that is running Ubuntu Linux Server Edition. I once had a Windows Server and it is easy to create web services using ASP.net on Windows. Linux on the other hand does support ASP.net using Mono, but is isn't as full featured as Windows. So what would be the best way to create xml web services on a linux server box?
Thanks
A web service can be written in any language. A web service is a program that takes request and returns response (xml or json) via http protocol. You can use a web server like Apache or lighthttpd to handle the http(s) and multithreading for you and write a simple script to do the actual work. The script can be written in anything - php, perl, python, shellscript, cgi c++, free pascal cgi etc.
Of course, You can write everything on your own by using TCP sockets, but this is not your goal I guess.
For FOSS I'd do it in php, because it`s easy:http://davidwalsh.name/web-service-php-mysql-xml-json
If I want it compiled, i'd use FreePascal as in this guide: http://leonardorame.blogspot.com/2010/02/web-20-programming-with-object-pascal.html
Or If I prefer C++, I'd use QTCreator with this guide: http://libqxt.bitbucket.org/doc/tip/tech-web.html
If you want to use ASP.net then use a windows server.
If you have to use Linux for some reason then you need to learn another language to work properly in the linux environment.
Linux web development is actually a world of difference from Windows web development. In leau of the bureaucracy of "applications" and "web services" we have scripts you can invoke via Apache, and if you want to get more advanced, daemons that can handle TCP/IP connections.
If you want to use something specific like SOAP, you should mention it in there, but as far as I know, Linux web development isn't service-based like Windows is.
There are many ways to do this, but given your ASP.NET background why not give the MonoDevelop IDE a go, it has matured a lot and will continue to do so.
Another option is using Eclipse (Java or PHP).
Depends mostly on the web server and web language you run on Linux more than anything else.
If you're using Apache Tomcat, look at Axis2 (http://ws.apache.org/axis2/) and CXF (formerly XFire at http://cxf.apache.org/)
JBoss has web service support built-in (JBossWS) so it's fairly easy to use and since it's a Java EE server, it uses standard web service code that is portable.
You can also write web services using PHP if you use that on your web server.
Apache = IIS
PHP or Java EE or JSP or JSF = ASP.Net
There are a lot more choices in Linux land...
I came across the same problem recently. I wanted a thin layer to turn my SQL database into a webservice with JSON or XML support. All I wanted to do was to have to write the SQL statements... it seemed a pretty reasonable thing to ask.
However, all the options I found involved installing some sort of enterprisy "do everything" solution. So I ended up writing some "glue" which took SQL statements defined in XML "dataset" definitions, and served a simple, RESTful web service.
I documented my approach here:
http://www.nsquared.co.nz/jarvis-docs/jarvis_guide.odt
If you want to use the framework, I can give you a tarball of the latest release. It's used in three or four small applications currently, 2 ExtJS, 1 Flex, and 1 Asp.Net.
There's a plethora of materials available with a simple search for "PHP Web Service" on Google. I'm not really sure what language you're using or what type of service you want to set up so I went with PHP Soap.
http://www.onlamp.com/pub/a/php/2007/07/26/php-web-services.html
There's a lot of industry standard specification and implementation in Java dealing with all aspects of server side web programming.
Start off by an open source implementation such as Apache Tomcat and/or any of http://ws.apache.org/
I guess the best answer depends a bit on what you really need, but one option is to use any of the recent web frameworks, such as Rails, CakePHP, or Django, which allow you to easily define database backed models, and then compose dynamic sites. Turnaround on these frameworks can be measured in minutes for simple sites.
Although it is based on a commercial product the following is an excellent primer to assist you in understanding how you would develop a Java based web service on Linux. If you find a similar tutorial based on free software please share it.
"So what would be the best way to create xml web services on a linux server box?"
A web framework like Turbogears, Django, Grok, Repoze.BFG, WebPy or such.
Related
After a couple hours of searching top lists of free "web servers" and "web frameworks" on google, I realized I'm not sure what I'm looking at.
Let's take a couple of example softwares I have come across :
IIS
Apache HTTP server
Apache Tomcat
Socket.io
Node.js
Django
Questions :
Do all these work on the same scope/do the same thing?
If not, what is absolutely necessary to have my "helloworld.html" acessible from anywhere with internet? Let's consider I already have a dedicated server and a domain
Also if not, how do these work together/compliment eachother?
Each of this software has a different description on their website for what it does, what it is, who should use it, it really gets confusing when you're trying to find what is "fresh", what the cool kids are using
IIS and Apache are web servers that support a variety of different technologies for plugging code into the web servers. So, if you were using one of these web servers, you would also use some other framework and language runtime to plug into them.
Apache Tomcat is a Java-based server framework for web applications. From the wikipedia page: "Apache Tomcat, often referred to as Tomcat, is an open-source Java Servlet Container developed by the Apache Software Foundation (ASF). Tomcat implements several Java EE specifications including Java Servlet, JavaServer Pages (JSP), Java EL, and WebSocket, and provides a "pure Java" HTTP web server environment in which Java code can run." It may be used independently of the Apache Web Server. The "Apache" in the name has to do with it being part of the Apache open-source organization. So, if you want to program your server in Java, this is one of your options.
node.js is a Javascript-based framework that is both a framework and it's own web server. So, if you want to program your web server in Javascript, this is your main option. There are additional frameworks you might use with node.js such as Express to make programming your web server simpler.
Django is a python-based framework. If you want to program your web server in Python, this is one of your choices.
socket.io is really not like any of the others. socket.io is a layer on top of webSockets that gives you a whole bunch of additional features over webSockets. This would run in whatever server-side language and framework you were already using and you would have to select a socket.io library that was compatible with your server technology. You can see a list of features that socket.io adds on top of a webSocket here: Moving from socket.io to raw websockets?. webSockets themselves are used for continuous communication between server and client (more efficient than repeated Ajax calls) and for push notification from server to client.
So, if you were looking to select a technology from scratch, there are a number of different ways you could start your selection process.
If you have a preferred language (Java, Python, Javascript, Ruby, C#, etc...) you either know already or want to learn, then you can look at the frameworks that support your language and start there. The framework will indicate whether you need a companion web server or whether than is already part of the framework.
If you have an existing hosting company that you want to use, you may need to understand which technologies they support so you don't select something that would require you to change hosting companies. Not all hosting companies support all technologies and some are better specialists in some technologies.
If you have specific 3rd party code or libraries you want to use, you may want to investigate which languages/frameworks it can more easily be used with.
What is fresh and what the cool kids are using changes pretty regularly. I would suggest that's a crummy criteria. What makes more sense is to understand which technologies and frameworks are doing well with accelerating growth and a rich development community behind them vs. which ones may be falling out of favor. I haven't myself done any sort of overall survey to offer any sort of list of what's on the upswing and doing well vs. what is more stagnant.
I'm personally partial to node.js and the huge NPM library of open-source and compatible code you can draw from and the ability to use one language for both front-end and back-end. It is certainly one of the choices that is growing rapidly and has a vibrant development community behind it. But, it is not the only choice that would meet those qualifications.
I need a recommendation for a framework/library for building web services on a Linux system. I have the following requirements:
It should have minimal dependencies, e.g. preferably not require any VM like Java or Mono.
My service implementation should have access to the native system APIs, preferably it should be possible to call C APIs directly.
If possible, the solution should not depend on a large web server installation. As I understand, Axis/C++ would require an Apache server, right? Is there anything that allows for writing some kind of "self-hosted" web service like in .NET (ServiceHost) on Linux? I would really like something that works as a standalone daemon in the end.
The resulting services should be standard-compliant as I need to make cross-platform calls. Most importantly, I need WS-Security.
The solution must be Open Source, the actual licence is less important.
If you have any suggestions, please post (web links would be nice ;-))
Thanks in advance,
Christoph
What about Twisted? http://twistedmatrix.com/trac/
I've went through several examples (shown below) based on the hopes that I could get WCF to work on the 4.0 framework in Mono.
Installing a Mono-Server for WCF
Indigo Infocard
However, the link on http://www.mono-project.com/WCF didn't seem to contain a "guide" so to speak as to "here's how to setup wcf on linux with mono". On a side note. I think I've checked the first two pages of google for most wcf/mono keyword combinations to no avail.
Is it possible to easily get a WCF service up and going on linux? I presume there may be some configuration on the apache2 side? (I'm running a lamp server with Ubuntu 11.10).
I took the stock 4.0 WCF Service Library and tested deploying it to my server and accessing the *.svc to see if I got the wsdl, however, I did get a status code of 500.
As far as alternatives. I'm thinking that http://www.servicestack.net/ is probably the best?
So there are a couple of questions:
Can you get WCF to work on Linux easily? If so, how? (Windows was easily done)
SOA Alternatives. Should I look at asmx (wcf did replace this) or go with Service Stack.
My goal (in a basic sense) is to pass data to a service and have it compute work. Nothing is returned.
servicestack.net itself (and all the live examples) runs on an Ubuntu 12.04 on a Hetzner vServer. All our live demos run on Nginx/MonoFastCgi.
Here is how to run a ServiceStack self-hosted service inside a Linux daemon which also includes configuration of hosting it behind an Apache or Nginx reverse proxy. This post was written by a team who moved to ServiceStack to fix their memory and performance issues with MVC on Mono.
I generally avoid trying to run any heavy Microsoft web frameworks on Mono unless the Mono team has expressed supported configuration. For WCF they've stated only the "Silverlight subset" of WCF is supported.
Microsoft themselves don't support or test on Linux so you will generally have a better experience with others that do.
I've also answered what I believe are the main differences between ServiceStack, WebApi and WCF in an earlier question here.
Ubuntu 11.10 has a very old version of Mono.
If you use Ubuntu 12.04, as it includes a newer version, it may just work.
I need to write a SOAP service for Linux (CentOS).
I need to do this using Lazarus/FreePascal. The service needs to be a binary (daemon) that runs in the background.
Questions:
1. Is this possible (as a standalone executable)?
2. If not, what are the alternatives?
3. How do I start?
4. What additional tools/libraries do I need?
This is possible with wst and either synapse or indy. wst is alsready included in your Freepascal download. There are some samples included as well, have a look at them.
I have created several soap services with wst + freepascal. You can choose to have them use their own webserver (so they just listen on a certain port, allows for simple debugging) or create an cgi module that you can use in Apache or IIS. You can also create a windows service or linux daemon, all by switching some parameters or including some other files.
It is not easy if you do it for the first time, but certainly possible.
I can answer some of your points since I'm doing it myself:
Using Lazarus and installing the LazDaemon package you can do daemons/services that compile and run stand alone on both Windows(Service) and Linux(Daemon). Daemons and Services
N/A
You have examples under the [fpc-source-dir]/packages/fcl-base/example/daemon.pp and under [lazarus-dir]/examples/cleandir/*
You will need some kind of SOAP framework that I'm not versed in.
Hope it helps.
This looks promising, at least as a start.
SOAP is a language neutral specification so in theory you could code in any language. But for your purposes if you can't find a library in pascal that does the grunt work you would be better off using any other language that does. Unless you are specifically looking for a long detour down the rabbit hole of WSDL and such, don't go there.
Is Pascal really a requirement??
Otherwise, you could write a SOAP service in Java, then your service would be platform agnostic.
The only requirement would be a JRE, and JRE are available for any platform, so it would run perfectly on all Linux flavors, WIndows, Mac OsS, Solaris, etc
There are also plenty of frameworks for doing SOAP in Java.
Pascal would also be able to run on Linux and Windows with minor adjustments, but I have no knowledge of existing good SOAP frameworks for Pascal.
I would just use Indy, and whatever Delphi soap lib a google search yielded. I would be surprised if there weren't a dozen.
I'm looking to set up a scalable server farm that serves up HTTP/SOAP requests and read/writes data from and to a (set of) database(s). Looking for the right Linux tools to handle that. Can someone please recommend a path for me? just a point in the right direction is all I require. In the past I used LAMP for PHP. What should I use jus for HTTP/SOAP? is there some kind of Apache extension for SOAP?
Apache webserver with Apache's Axis server for web services SOAP should be fine.
I'd suggest two general approaches:
Using Apache HTTPD and using PHP, Python or Perl, using SSI/CGI/mod_python/WSGI, depending on how you want to set up your application. (A variant of this is to use a standalone Python/Perl server if you don't need the benefits of Apache HTTPD.) PHP, Python and Perl have SOAP server-side libraries (I've found SOAP::Lite in Perl very hard to debug and work with, but there may be other libraries, or you may like it...)
Using a Java container, perhaps with something like Axis or Metro.