0
我在ubuntu服务器工作10.04gsoap web服务器 - 接受字符串值的方法?
我正在创建一个test.h文件,我想包含4个字符串值。
test.h
int ns__take(string name, string user, string eyes, string result);
//结果将是用户名和眼睛的strcat的//
。它是确定的?我可以在gsoap web服务服务器中使用字符串值吗?
。在test.cpp里面我可以写ns__take
方法result=strcat(name,user,eyes);
?
。有了这些字符串值,我该如何以编程方式打开文件并在该文件中写入值? 每次客户端访问Web服务,我想保存在一个文件中输入参数
4.多个客户端访问web服务在同一时间?这会影响我想写入输入参数的文件吗?
需要一些帮助!谢谢 。我是gsoap wsdl web服务的新手。
编辑:
这里是我的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;
}
我编译使用tests.cgi:
soapcpp2 test.h
> c++ -o tests.cgi test.cpp soapC.cpp soapServer.cpp -lgsoap++
嘿。 thx重播。有用。一切都好,直到第4点。我想问你同步化是什么意思?我发布了目前的test.cpp – 2012-01-10 14:20:45
非常感谢你的努力。我是gsoap,web服务的新手。我正在使用wsdl和tests.cgi。 – 2012-01-10 14:27:31
我认为你的test.cpp并不处理并发请求,所以你不必担心同步。 – 2012-01-10 15:11:02