使用gsoap开发webservice客户端和服务端

1、简介:

服务端环境:linux,实现访问Mysql数据库的功能(c语言实现)

客户端环境:windows+vs2008,实现访问服务端查询数据库(MFC实现)

2、头文件定义:

文件:mysql_opt.h

代码:

struct ns__stBayonetCar
{
    char* bId;
    char* bTime;
    char* eTime;
};
struct ns__stBayonetCarResponse
{
    int count;
    char* bId;
};
struct stBayonetCarRes
{
    struct ns__stBayonetCarResponse info;
};
struct ns__stBayonet
{
    char* bId;
};
struct stBayonetRes
{
    int __size;
    struct ns__stBayonet** __ptr;
};
int ns__connect_mysql(char* host, char* user, char* pwd, char** rst);
int ns__close_mysql(int* rst);
int ns__get_bayonet_count(int* rst);
int ns__get_bayonetcar_count(int* rst);
int ns__get_bayonetcar_bytime(struct ns__stBayonetCar* stIn, struct stBayonetCarRes* stOut);
int ns__get_bayonet(struct stBayonetRes* stOut);

3、使用gsoap生成客户端与服务端所需要的文件

(1)命令:./soapcpp2 -c -x web.h (其中,soapcpp2是安装gsoap目录bin文件夹下(linux环境,windows同样可以找到))

(2)客户端所需文件:

mysql_opt.nsmap、soapH.h、stdsoap2.h、soapStub.h、soapC.c、soapClient.c、stdsoap2.cpp

(3)服务端所需文件:

mysql_opt.nsmap、soapH.h、stdsoap2.h、soapStub.h、soapC.c、soapServer.c、stdsoap2.c

4、工程下载

(1)客户端:https://download.csdn.net/download/u013613158/10533158

(2)服务端:https://download.csdn.net/download/u013613158/10533143


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值