Hi,

first of all, I'm not sure if this forum is the right place to ask my question. If not, please indicate where I should move it to.

I'm currently working on a c++ server application (basically a calculation server, details don't matter here). I need a graphical web interface for this server. I've been looking for a C++ web framework, but the only one I've come across is Wt and it doesn't seem to be used widely.

However, I've been using Drupal for a while now and I like it a lot, so I would also like to use it to create my web interface. However, what I don't know is if Drupal can integrate with a C++ back-end, or if I would have to write a module myself to somehow provide an interface between PHP and C++ to Drupal.

Has anyone done something like this before? Is it possible?

Thanks in advance.

Comments

lorinpda’s picture

Hi,
A quick suggestion. Communicate with xml over over http.

Add a request dispatcher to your current server that listens on port 80 (http).

User visit's Drupal installaton. Drupal renders calculation form (I.E. web form that collects user's request, operation, parameters, etc).

Drupal installation packages up user's request as xml, sends it to your current c++ server (http request).

Current server performs calculation returns xml result.

Drupal parses xml result and constructs html response. Drupal renders result (in html).

SAX is a standard XML processing. You can google and find the appropriate C++ implementation for your current server.

You would write a custom Drupal module to send and receive your xml messages (on the Drupal end). Drupal is written in php. You can implement a SAX parser in php. See
http://www.php.net/manual/en/function.xml-parse.php.

Or, check for XML-RPC.

Again. just wanted to give you a quick design pattern.

Hope that helps (at least gets you started),

modem’s picture

Hi,

thanks for your reply. I've been looking into your suggestions, and XML-RPC will probably do the trick for us.

foredoc’s picture

Hi Modem,

I am running into the same problem, and can you share with me some of your insights?

Thanks.

foredoc

pdhruvit2407’s picture

Hi,

I am graduate student and recently, i am going to make website which connect website to back-end server. Actually, server was codded in c++ and i don't know how to make connection between drupal website and c++ server. Can you gove full enlighten on this topic because my problem same as like you. If there is no solution then forcefully,i have to adopt Wt for codding which thing i don't want to do.

Thank you in advance.

Jaypan’s picture

You can use the Services module to create a REST server within Drupal, the you can create your app/site within C++, and push/pull data from the REST server.

dpatte’s picture

please see my comments at https://groups.drupal.org/node/493123

Jaypan’s picture

I just read the comments at the link you provided.

In this case, you will need to build the authentication mechanism into your C++ app, and provide someway in that app of providing data to a URL when requested. This is all done on the C++ side, and you won't be able to get much assistance here for that, as Drupal isn't C++ and most of us will not know it well enough to be able to help.

To retrieve the data from C++, you can use the drupal_http_request() function. This function allows you to make GET, POST, PUT and DELETE requests through HTTP, to retrieve data from an external source. It's all you need on the Drupal end.