第一次搞webservice,请问几个基础问题。

llm06 2010-09-06 11:07:07
以前重来没有搞过webservice,有两个基础问题想请问一下。
webservice访问地址
http://192.168.0.1/Query VehicleSrc/Service.asmx
(1) 对外公布方法名:
Public string GetInfo(String queryName,string queryPass,int type)
请问一下,我在给
Connector->Property["EndPointURL"]和
Connector->Property["SoapAction"]
赋值的时候该怎样正确赋值,
第一次搞,不好意思。
或者哪位给个完整的调用代码,包括参数传递和获取返回值,非常感谢!
...全文
119 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuchongjike 2010-09-24
  • 打赏
  • 举报
回复
VS有集成的环境,可以直接拉出来用.
VC6你可以下个gSoap,这个很好用.我的WebService一直都用的这个.
给你一个gSoap的例子

bool MES_FTService::GetItemNo(const char* strBarcode,char* strResult)
{
bool bResult = true;
_MESService1__GetItemNo sendSoap;
_MESService1__GetItemNoResponse reSoap;

strcpy(sendSoap.sBarcode,strBarcode);
try
{
soap_call___MESService2__GetItemNo(this->m_SoapClient,this->m_strURL,NULL,&sendSoap,&reSoap);
strcpy(strResult,reSoap.GetItemNoResult);
}
catch(_exception )
{
bResult = false;
}
return bResult;
}
MoXiaoRab 2010-09-06
  • 打赏
  • 举报
回复
看我的博客里的OpenAPI系列文章,看完你就都会了
oyljerry 2010-09-06
  • 打赏
  • 举报
回复
[Quote=引用楼主 llm06 的回复:]
以前重来没有搞过webservice,有两个基础问题想请问一下。
webservice访问地址
http://192.168.0.1/Query VehicleSrc/Service.asmx
(1) 对外公布方法名:
Public string GetInfo(String queryName,string queryPass,int type)
请问一下,我在给
Connector……
[/Quote]

用VS2005以后编译器,可以直接添加web service的reference,然后编译器会自动帮你生成包装类,你就可以直接调用GetInfo的方法了, EndPointURL,SoapAction属性就不需要你管了

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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