Sunday, April 6, 2008

Writing Web Services In C/C++

Source: gSoap

Ever felt the need to take a C/C++ application and want to bridge to new languages such as Java or the .Net framework. This could be from a high powered massively parallel computer or a really tiny hand-held or a robot that runs some small code in C. Fortunately there is a really good toolkit called "gSoap" that will come really handy. The general sequence to build the bridge is as follows:

1. Build an interface definition file with SOAP data types [similar to the IDL file for those that ever used RPC].
2. Generate the client and server stubs - This is where gSoap really comes handy.
3. Implement the interface routines - These map from the SOAP data types to internal calls that can be linked with the application in question.

That's pretty much it for the interface part. As for a listener or a web-server, anything that can listen on a specific port is good enough. If you really want to use a web-server that's also an option though in most tight applications, there isn't that much space available. The code generated seems to be highly modular and there is provision to handle binary data as well which make this toolkit very useful for small or large datasets. In case there is any application that is under consideration for a massive re-write or brushed aside for lack of web-interfaces, think again .. gSoap is right there to help.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home