在 C++ 中开发 Web 服务的好平台是什么? [英] What is a good platform for devoloping web services in C++?

查看:21
本文介绍了在 C++ 中开发 Web 服务的好平台是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在考虑开发一个 Web 服务,作为用 C++ 编写的网络安全原型的浏览器显示/GUI 的基础.我在 Web 服务方面的经验仅限于 Java.我更喜欢 Java 中的 Web 服务,因为它走在老路"上.

We're looking at developing a Web Service to function as a basis for a browser display/gui for a networked security prototype written in C++. My experience with web services has been limited to Java. I prefer Web Services in Java because it's on the "beaten path".

可以肯定的做法是简单地编写一个调用 Web 服务的 Java 客户端,并将其作为命令行调用,并带有来自 C++ 代码的参数.

One sure was to do this would be to simply code a Java client which invokes the web service, and call it as a command line with parameters from the C++ code.

这并不理想,因为一般来说 API 更可取,但在这种情况下,它会起作用并且是一个非常安全的解决方案.

It's not ideal, since generally speaking an API is preferable, but in this case it would work and be a pretty safe solution.

在 C++ 中处理 Web 服务开发的资源称为 gSOAP,网址为:http://gsoap2.sourceforge.net

A resource which does handles web service development in C++ is called gSOAP, at this url: http://gsoap2.sourceforge.net

有没有想过哪种方法更好?有没有人用过 gSOAP,如果有,你怎么看?

Any thought on which is a better approach? Has anyone used gSOAP, and if so, what did you think?

推荐答案

我的同事最终将 Axis2/java(用于服务)和 gsoap 用于客户端.他通过从 C++ 头文件(使用 c2wsdl (?) 或类似的东西)生成它从 Java 服务创建了 wsdl.他说这比使用 Java 接口更好,因为它生成了两套 wsdl,用于不同版本的soap.

My colleague ended up using a combination of Axis2 / java (for the service) and gsoap for the client. He created the wsdl from the Java service by generating it from a C++ header (using c2wsdl (?) or something like that. He said it was better than using a Java interface because that generated two sets of wsdl, for seperate versions of soap.

然后他使用 wsdl2java 生成了 web 服务和一个测试 web 客户端.一旦我们开始工作,他就使用 gsoap 创建了 Web 客户端(使用 C++),并且运行良好.

Then he used wsdl2java to generate the webservice and a test web client. Once we got that working, he used gsoap to create the web client (in C++), and it worked fine.

感谢所有的回答!我结束了使用它们的组合.

thanks for all the answers! I ended using a combination of them.

这篇关于在 C++ 中开发 Web 服务的好平台是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆