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服务,作为用C ++编写的网络安全原型的浏览器显示/ gui的基础。我在Web服务方面的经验仅限于Java。我更喜欢Java中的Web服务,因为它处于“常规路径”。
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.
一个可靠的做法是简单地编写一个调用Web服务的Java客户端,并将其称为带有C ++代码参数的命令行。
It's not ideal, since generally speaking an API is preferable, but in this case it would work and be a pretty safe solution.
它并不理想,因为一般来说API更可取,但在这种情况下,它可以工作并且是一个非常安全的解决方案。
A resource which does handles web service development in C++ is called gSOAP, at this url: http://gsoap2.sourceforge.net
在C ++中处理Web服务开发的资源称为gSOAP,在此URL:http://gsoap2.sourceforge.net
Any thought on which is a better approach? Has anyone used gSOAP, and if so, what did you think?
有什么想法是更好的方法?有没有人使用过gSOAP,如果有的话,你觉得怎么样?
8 个解决方案
#1
I'd done things with gSOAP, it's not awful. I'm increasingly opposed to the RPC model for web services, though; it forces you into a lot of connection and session state that adds complexity. A REST interface is simpler and more robust.
我用gSOAP做过一些事情,这并不可怕。但是,我越来越反对Web服务的RPC模型;它迫使你进入大量的连接和会话状态,增加了复杂性。 REST接口更简单,更健壮。
#3
For RPC style, have a look at Thrift, I found it quite better ( faster, clearer, a lot of languages implementations) than soap.
对于RPC风格,看看Thrift,我发现它比soap更好(更快,更清晰,很多语言实现)。
#4
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.
我的同事最终使用了Axis2 / java(用于服务)和gsoap用于客户端的组合。他通过从C ++标头生成它来创建wsdl(使用c2wsdl(?)或类似的东西。他说它比使用Java接口更好,因为它产生了两组wsdl,用于单独版本的soap。
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.
然后他使用wsdl2java生成web服务和测试Web客户端。一旦我们开始工作,他就用gsoap创建了Web客户端(用C ++编写),并且工作正常。
thanks for all the answers! I ended using a combination of them.
感谢所有的答案!我结束了他们的组合。
#5
I had very good experience with gsoap - very simple, performance is good.
我对gsoap有很好的经验 - 非常简单,性能很好。
#6
If it is acceptable to run only on Windows, there is a brand-new API for that purpose: WWSAPI
如果只能在Windows上运行,那么就有一个全新的API:WWSAPI
#7
Instead of calling the java client from the command line, you can create a java virtual machine inside your C app, instantiate the class and call any methods. This is what the java.exe app does and I think the source code is included in the jdk.
您可以在C app中创建一个java虚拟机,实例化该类并调用任何方法,而不是从命令行调用java客户端。这是java.exe应用程序的功能,我认为源代码包含在jdk中。
#1
I'd done things with gSOAP, it's not awful. I'm increasingly opposed to the RPC model for web services, though; it forces you into a lot of connection and session state that adds complexity. A REST interface is simpler and more robust.
我用gSOAP做过一些事情,这并不可怕。但是,我越来越反对Web服务的RPC模型;它迫使你进入大量的连接和会话状态,增加了复杂性。 REST接口更简单,更健壮。
#2
To me is Axis C++.
对我来说是Axis C ++。
#3
For RPC style, have a look at Thrift, I found it quite better ( faster, clearer, a lot of languages implementations) than soap.
对于RPC风格,看看Thrift,我发现它比soap更好(更快,更清晰,很多语言实现)。
#4
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.
我的同事最终使用了Axis2 / java(用于服务)和gsoap用于客户端的组合。他通过从C ++标头生成它来创建wsdl(使用c2wsdl(?)或类似的东西。他说它比使用Java接口更好,因为它产生了两组wsdl,用于单独版本的soap。
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.
然后他使用wsdl2java生成web服务和测试Web客户端。一旦我们开始工作,他就用gsoap创建了Web客户端(用C ++编写),并且工作正常。
thanks for all the answers! I ended using a combination of them.
感谢所有的答案!我结束了他们的组合。
#5
I had very good experience with gsoap - very simple, performance is good.
我对gsoap有很好的经验 - 非常简单,性能很好。
#6
If it is acceptable to run only on Windows, there is a brand-new API for that purpose: WWSAPI
如果只能在Windows上运行,那么就有一个全新的API:WWSAPI
#7
Instead of calling the java client from the command line, you can create a java virtual machine inside your C app, instantiate the class and call any methods. This is what the java.exe app does and I think the source code is included in the jdk.
您可以在C app中创建一个java虚拟机,实例化该类并调用任何方法,而不是从命令行调用java客户端。这是java.exe应用程序的功能,我认为源代码包含在jdk中。
#8
Depends on how low level you want to go. You might checkout yield.
取决于你想要的低水平。你可以结账收益率。