怎样让BCB5调用WebService?

leonpard 2005-07-19 12:04:12
以前BCB5做的一个程序,有一大堆控件,没办法移植到BCB6下面。
但是现在要增加一个访问WebService的功能.
所以我想把BCB6调试通过的webservice访问代码导出成为一个dll给BCB5调用,
但是这种“接口”既不是类,又不是函数,怎么声明才能导出呢?
头文件如下,请各位指点,谢谢!

webservice提供的是一个类ServiceSystem,类公开了6个方法


// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://localhost:8080/backend/services/ServiceSystem?wsdl
// Encoding : UTF-8
// Version : 1.0
// (2005-7-15 16:20:53 - $Revision: 1.0.1.0.1.82 $)
// ************************************************************************ //

#ifndef ServiceSystemH
#define ServiceSystemH

#include <System.hpp>
#include <InvokeRegistry.hpp>
#include <XSBuiltIns.hpp>
#include <SoapHTTPClient.hpp>


namespace NS_ServiceSystem {

// ************************************************************************ //
// The following types, referred to in the WSDL document are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in the document. The types from the latter category
// typically map to predefined/known XML or Borland types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
// !:string - "http://schemas.xmlsoap.org/soap/encoding/"
// !:long - "http://www.w3.org/2001/XMLSchema"


// ************************************************************************ //
// Namespace : http://Business
// transport : http://schemas.xmlsoap.org/soap/http
// style : rpc
// binding : ServiceSystemSoapBinding
// service : ServiceSystemService
// port : ServiceSystem
// URL : http://localhost:8080/backend/services/ServiceSystem
// ************************************************************************ //
__interface INTERFACE_UUID("{18ECD1A3-AA58-BB5B-88FF-C0236580C953}") ServiceSystem : public IInvokable
{
public:
virtual AnsiString query(const AnsiString msg) = 0;
virtual void setMsgMediaObject(const AnsiString msgMediaObject) = 0;
virtual __int64 getTimeCost() = 0;
virtual AnsiString calcHMS(const __int64 timeInMillSeconds) = 0;
virtual AnsiString getMsgMedia() = 0;
virtual void setMsgMedia(const AnsiString msgMedia) = 0;
};
typedef DelphiInterface<ServiceSystem> _di_ServiceSystem;

_di_ServiceSystem GetServiceSystem(bool useWSDL=false, AnsiString addr="");



#endif // __ServiceSystem_h__

}; // NS_ServiceSystem

#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace NS_ServiceSystem;
#endif

...全文
380 4 打赏 收藏 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
northsoft_ 2005-11-16
  • 打赏
  • 举报
回复
bcb6开发webservice程序的时候也有严重问题,比如我用bcb自带向导生成的soap server application\cgi程序 自己没有添加任何代码,竟然生成wsdl的时候出错,晕,最后没办法用delphi做了一个,狂晕。。。同样的代码在delphi下一切正常
suntonycomm 2005-07-26
  • 打赏
  • 举报
回复
bcb5 的程序完全可以无困难用bcb6的编译并且正常运行,


至于,webservice 的话最好用bcb6来做,省好多不必要的麻烦事,它还提供了更多的工具。

至于,调用什么做的service 并不重要,对于bcb来说基本是完全一样的。
leonpard 2005-07-19
  • 打赏
  • 举报
回复
to clockwise3(Max)

1. webservice是部署在tomcat的javabean
2. BCB5不支持WebService.
clockwise3 2005-07-19
  • 打赏
  • 举报
回复
你说的问题其实很简单啊,由C++Builder实现的WebService当然可以被别人调用了。不然怎么是WebService呢?如果你是生成了ISAPI类型的dll只需要一个IIS服务器就可以对外提供服务了。让BCB5加载服务的WSDL文件就可以了,都有向导帮你完成的。很简单。

684

社区成员

发帖
与我相关
我的任务
社区描述
智能路由器通常具有独立的操作系统,包括OpenWRT、eCos、VxWorks等,可以由用户自行安装各种应用,实现网络和设备的智能化管理。
linuxpython 技术论坛(原bbs)
社区管理员
  • 智能路由器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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