Web Services Without Pain: gSOAP Writes Your XML, SOAP, and RPC.

Fri Jan 11 10:13:22 -0800 2008
manage
It's often necessary to build server and client applications. In the 80's and 90's, these were done using protocols that looked very much like command-lines. HTTP, SMTP, FTP, and other popular facilities are a legacy of those days. But the current state of the art is to use web services. Unlike the old style, a web service, once its schema is written, can immediately be machine validated for correctness. Automatic generation of client or server software for that service is possible using only the schema as input. The benefits are portability of a service to clients in all languages, and a much higher quality standard for interoperability.

The downside to web services is that they look as if they were designed by Bertrand Russell and Donald Knuth, from first principles like a theorem in Principia Mathematica. Each web service definition starts by including the formal schema of XML, and builds from there, including the formal schema of SOAP and of web services definition files themselves. At that point you get to define your functions, and their arguments and return values, all in nit-picking precision and repetition, repetition, repetition, in a language that only a computer would love. It is this rampant anal-retentiveness that enables machine analysis and machine generation, at the cost of making any human who writes it work like a machine.

But now we are liberated from this toil. The machine will do the writing for us, from a simple and concise specification that programmers can relate to. And the program that works this miracle is Free Software.

Its name is gSOAP. It takes a header defining C or C++ functions, or a URL for someone else's web service definition, and automatically writes both clients and servers in C or C++. The impact of this program on a programmer's task is as great as that of a compiler converting a high-level-language to assembly code.

To demonstrate that, I'll write a web service in one line:

                  int sv__add(int a, int b, int * result);
                  

Looks familiar? That's a function definition from a C or C++ header, in a style suggested by the gSOAP manual. The theoretical web service adds two numbers and returns the result. Running the C++ to SOAP translator on that header:

soapcpp2 service.h
A number of files are generated:
                  soapClientLib.cpp  soapProxy.h     soapStub.h
                  sv.nsmap           soapC.cpp       soapH.h
                  soapServer.cpp     sv.add.req.xml  sv.wsdl
                  soapClient.cpp     soapObject.h    soapServerLib.cpp
                  sv.add.res.xml     sv.xsd
                  

These files include implementations of servers and clients that need only be connected to a simple main() function and a function to do the work. Also generated are a formal definition of the new service in WSDL and XSD formats, that can be served from your web site to enable validating parsers and code generators everywhere to validate and parse your service and to build interoperable code for it.

The bottom line is that the programmer can almost entirely ignore the complication of XML, SOAP, and RPC, because software does most of the work for him. The cost of this to the programmer is about a day's work reading the gSOAP manual and building simple examples, a cost that gSOAP will repay multiply the first time it's used.

Generation of services using SSL and authentication is supported. The output of the C or C++ to web-service and code tool is usable for building both proprietary and Free Software without a commercial license. The web-service-definition to code tool, mostly used for creating clients for web services defined by others, would require a commercial license for the development of proprietary software. Commercial support is available. gSOAP can literally shave weeks and many thousands of dollars off of the cost of developing new server-client software.

Web Services Without Pain: gSOAP Writes Your XML, SOAP, and RPC.
Fri Jan 11 12:06:42 -0800 2008
manage
now we are liberated from this toil

Umm, haven't we always been liberated from this toil? Maybe it's new in C/C++ land, but auto generation of the SOAP cruft has been around for years in Java.
Web Services Without Pain: gSOAP Writes Your XML, SOAP, and RPC.
Fri Jan 11 12:51:10 -0800 2008
manage
Well, gSOAP is up to version 2.7, so I suppose it's not brand-new either. However if you do web searches for tools for working with XML RPCs, there are lots of low-level tools with awful learning curves and terrible programmer load to code with, and they don't tell you "don't look here, there's a good autogenerator". So, this introduction is intended for folks like me (primarily an operating systems programmer) who are not up to full-speed on things that people who mostly do web development would know.

Bruce

Web Services Without Pain: gSOAP Writes Your XML, SOAP, and RPC.
Fri Jan 11 15:38:37 -0800 2008
manage

... like me (primarily an operating systems programmer)  ...

Been there, done that! I hacked into the kernel of both AIX and Solaris when building systems that in market feeds. Kept running up against the Reuters Triarc marketing machine and had to re-invent myself so many times!

Web Services Without Pain: gSOAP Writes Your XML, SOAP, and RPC.
Fri Jan 11 13:00:58 -0800 2008
manage
Sounds to me like we are back to the state of things when RPC was the thing.

You wrote your .idl file, ran it thru the idl compiler, and it spit out files you  used
in your app ( and in the server part, IIRC ).

I have often wondered how web services where
A:  Any improvement over RPC
B:  innovative
C:  worth all the hype and hoopla.