在C++ builder里调用webservice问题 急急急

smdszgzh 2010-09-06 12:19:21
各位高手,我现在遇到这么一个问题,就是在C++ builder里调用webservice时,无论我在C++ builder里传递的是什么参数,在webservice里捕获到的参数永远是0


webservice里的函数如下:

/// <summary>
/// 获取一个抽屉的信息(回单检索时用)
/// </summary>
/// <param name="drawer_no"></param>
/// <returns></returns>
[WebMethod(true)]
public String GetDrawerInfo(int drawer_no)
{
// if (CheckSession == false)
// return "-1|未登录系统或后台会话丢失|";
Session.Add("atc_id", "ST000001");
Session.Add("user_id", "80016601");
DataSet ds = SqlHelper.ExecuteDataset(CONSTR,
"xyz_get_drawer_info",
Session["atc_id"].ToString(),
Session["user_id"].ToString(),
drawer_no
);

return DataSetToString(ds);
}



C++ builder里的声明如下:

virtual AnsiString GetDrawerInfo(const int drawer_no) = 0;


请帮忙解决一下,我比较急!
...全文
290 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zzbinfo 2010-09-06
  • 打赏
  • 举报
回复
zzbinfo 2010-09-06
  • 打赏
  • 举报
回复 1
呵呵,这个问题我也遇到过,你这样处理
第三步,编辑生成的Service.cpp:

生成的文件中最后有一段如下代码:

static void RegTypes()
{
/* ServiceSoap */
InvRegistry()->RegisterInterface(__interfaceTypeinfo(ServiceSoap), L"http://tempuri.org/", L"utf-8");
InvRegistry()->RegisterDefaultSOAPAction(__interfaceTypeinfo(ServiceSoap), L"http://tempuri.org/%operationName%");
}

在后面添加一行,改成这样:

static void RegTypes()
{
/* ServiceSoap */
InvRegistry()->RegisterInterface(__interfaceTypeinfo(ServiceSoap), L"http://tempuri.org/", L"utf-8");
InvRegistry()->RegisterDefaultSOAPAction(__interfaceTypeinfo(ServiceSoap), L"http://tempuri.org/%operationName%");
InvRegistry()->RegisterInvokeOptions(__interfaceTypeinfo(ServiceSoap), ioDocument);
}



本文来自CSDN博客,转载请标明出处:

13,870

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧