gsoap Web 服务服务器 - 接受字符串值的方法?
我正在 ubuntu 服务器 10.04 中工作,
我正在创建一个 test.h 文件,我想包含 4 个字符串值。
test.h
int ns__take(string name, string user, string eyes, string result);
//结果将是一个 strcat //name user 和 eyes
1.It is ok ?我可以在 gsoap Web 服务服务器中拥有字符串值吗?
2。在 test.cpp 中,我可以在 ns__take
方法 result=strcat(name,user,eyes);
中编写吗?
3。使用这些字符串值,我如何以编程方式打开文件并将值写入该文件? 每次客户端访问Web服务时,我都希望将输入参数保存在文件中
4.多个客户端可以同时访问Web服务吗?这会对我想要写入输入参数的文件产生不良影响吗?
需要一些帮助!谢谢 。我是 gsoap wsdl Web 服务的新手。
编辑:
这是我的测试.cpp
#include "soapH.h"
#include "tests.nsmap"
#include <math.h>
main()
{
soap_serve(soap_new());
}
int ns__take(struct soap *soap, std::string a, std::string b, std::string &result)
{
result=a+b;
//
..here i want to add the open file and write the values a,b.
do i need a synchronization if multiple clients acces in the same time the method?
how will that be?
//
return SOAP_OK;
}
我正在使用以下命令编译tests.cgi:
soapcpp2 test.h
> c++ -o tests.cgi test.cpp soapC.cpp soapServer.cpp -lgsoap++
I am working in ubuntu server 10.04
I am creating a test.h file which I want to contain 4 string values.
test.h
int ns__take(string name, string user, string eyes, string result);
//the result will be a strcat //of name user and eyes
1.It is ok? Can i have string values in gsoap web service server?
2. In test.cpp can I write inside ns__take
method result=strcat(name,user,eyes);
?
3.With these string values how can I programatically open a file and write the values in that file?
Each time a client accesses the web service I would like to save the input parameters in a file
4. Can multiple clients access the webservice in the same time? Will this affect in a bad way the file where i want to write the input parameters?
Need some help! THX . I am new to gsoap wsdl web service.
EDIT:
HERE IS MY test.cpp
#include "soapH.h"
#include "tests.nsmap"
#include <math.h>
main()
{
soap_serve(soap_new());
}
int ns__take(struct soap *soap, std::string a, std::string b, std::string &result)
{
result=a+b;
//
..here i want to add the open file and write the values a,b.
do i need a synchronization if multiple clients acces in the same time the method?
how will that be?
//
return SOAP_OK;
}
I am compiling the tests.cgi using:
soapcpp2 test.h
> c++ -o tests.cgi test.cpp soapC.cpp soapServer.cpp -lgsoap++
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
result=name+user+eyes
或一些类似的string
,这些是std::string
类对象result=name+user+eyes
or some such,string
, these arestd::string
class object