C++Builder+WSDL怎么设计程序。

yshff 2007-03-28 09:29:33
由WSDL文件生成的C++builder程序见以下:
//----主文件CorpEntityService.cpp---
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : G:\web\wsdl\CorpEntityService.wsdl
// Encoding : UTF-8
// Version : 1.0
// (2007-3-28 21:09:17 - $Revision: 1.0.1.0.1.82 $)
// ************************************************************************ //

#include <vcl.h>
#pragma hdrstop

#if !defined(CorpEntityServiceH)
#include "CorpEntityService.h"
#endif



namespace NS_CorpEntityService {

_di_CorpEntityEndpoint GetCorpEntityEndpoint(bool useWSDL, AnsiString addr)
{
static const char* defWSDL= "G:\web\wsdl\CorpEntityService.wsdl";
static const char* defURL = "http://220.165.93.74:8080/ncms/services/CorpEntityService";
static const char* defSvc = "CorpEntityEndpointService";
static const char* defPrt = "CorpEntityService";
if (addr=="")
addr = useWSDL ? defWSDL : defURL;
THTTPRIO* rio = new THTTPRIO(0);
if (useWSDL) {
rio->WSDLLocation = addr;
rio->Service = defSvc;
rio->Port = defPrt;
} else {
rio->URL = addr;
}
_di_CorpEntityEndpoint service;
rio->QueryInterface(service);
if (!service)
delete rio;
return service;
}


__fastcall CorpEntityWSResultDTO::~CorpEntityWSResultDTO()
{
delete FdateOfBirth;
}

// ************************************************************************ //
// This routine registers the interfaces and types used by invoke the SOAP
// Service.
// ************************************************************************ //
static void RegTypes()
{
/* CorpEntityEndpoint */
InvRegistry()->RegisterInterface(__interfaceTypeinfo(CorpEntityEndpoint), L"http://com.bdcc.ncms.webservice.corpentity.CorpEntityService", L"UTF-8");
InvRegistry()->RegisterDefaultSOAPAction(__interfaceTypeinfo(CorpEntityEndpoint), L"");
/* User */
RemClassRegistry()->RegisterXSClass(__classid(User), L"http://security.webservice.ncms.bdcc.com", L"User");
/* CorpEntityWSParamDTO */
RemClassRegistry()->RegisterXSClass(__classid(CorpEntityWSParamDTO), L"http://dto.corpentity.ncms.bdcc.com", L"CorpEntityWSParamDTO");
/* CorpEntityWSResultDTO */
RemClassRegistry()->RegisterXSClass(__classid(CorpEntityWSResultDTO), L"http://dto.corpentity.ncms.bdcc.com", L"CorpEntityWSResultDTO");
}
#pragma startup RegTypes 32

}; // NS_CorpEntityService



///////////------------CorpEntityService.h文件--------
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : G:\web\wsdl\CorpEntityService.wsdl
// Encoding : UTF-8
// Version : 1.0
// (2007-3-28 21:09:17 - $Revision: 1.0.1.0.1.82 $)
// ************************************************************************ //

#ifndef CorpEntityServiceH
#define CorpEntityServiceH

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


namespace NS_CorpEntityService {

// ************************************************************************ //
// 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://schemas.xmlsoap.org/soap/encoding/"
// !:NcmsBaseDTO - "http://dto.corpentity.ncms.bdcc.com"
// !:dateTime - "http://www.w3.org/2001/XMLSchema"

class User;
class CorpEntityWSParamDTO;
class CorpEntityWSResultDTO;



// ************************************************************************ //
// Namespace : http://security.webservice.ncms.bdcc.com
// ************************************************************************ //
class User : public TRemotable {
private:
AnsiString Fpassword;
AnsiString FuserName;
public:
__published:
__property AnsiString password = { read=Fpassword, write=Fpassword };
__property AnsiString userName = { read=FuserName, write=FuserName };
};




// ************************************************************************ //
// Namespace : http://dto.corpentity.ncms.bdcc.com
// ************************************************************************ //
class CorpEntityWSParamDTO : public TRemotable {
private:
AnsiString FcardNo;
__int64 FpersonCode;
AnsiString FpersonName;
public:
__published:
__property AnsiString cardNo = { read=FcardNo, write=FcardNo };
__property __int64 personCode = { read=FpersonCode, write=FpersonCode };
__property AnsiString personName = { read=FpersonName, write=FpersonName };
};




// ************************************************************************ //
// Namespace : http://dto.corpentity.ncms.bdcc.com
// ************************************************************************ //
class CorpEntityWSResultDTO : public TRemotable {
private:
AnsiString Faddress;
AnsiString FcardNo;
TXSDateTime* FdateOfBirth;
AnsiString FerrorCode;
AnsiString Fidentification;
AnsiString FisActive;
__int64 FpersonCode;
__int64 FpersonId;
AnsiString FpersonName;
AnsiString Fsex;
AnsiString Fstatus;
public:
__fastcall ~CorpEntityWSResultDTO();
__published:
__property AnsiString address = { read=Faddress, write=Faddress };
__property AnsiString cardNo = { read=FcardNo, write=FcardNo };
__property TXSDateTime* dateOfBirth = { read=FdateOfBirth, write=FdateOfBirth };
__property AnsiString errorCode = { read=FerrorCode, write=FerrorCode };
__property AnsiString identification = { read=Fidentification, write=Fidentification };
__property AnsiString isActive = { read=FisActive, write=FisActive };
__property __int64 personCode = { read=FpersonCode, write=FpersonCode };
__property __int64 personId = { read=FpersonId, write=FpersonId };
__property AnsiString personName = { read=FpersonName, write=FpersonName };
__property AnsiString sex = { read=Fsex, write=Fsex };
__property AnsiString status = { read=Fstatus, write=Fstatus };
};



// ************************************************************************ //
// Namespace : http://com.bdcc.ncms.webservice.corpentity.CorpEntityService
// transport : http://schemas.xmlsoap.org/soap/http
// style : rpc
// binding : CorpEntityServiceSoapBinding
// service : CorpEntityEndpointService
// port : CorpEntityService
// URL : http://localhost:8080/ncms/services/CorpEntityService
// ************************************************************************ //
__interface INTERFACE_UUID("{E9115789-3B20-0C6B-37C5-35E5B5BE203D}") CorpEntityEndpoint : public IInvokable
{
public:
virtual CorpEntityWSResultDTO* getCorpEntity(const User* user, const CorpEntityWSParamDTO* dto) = 0;
};
typedef DelphiInterface<CorpEntityEndpoint> _di_CorpEntityEndpoint;

_di_CorpEntityEndpoint GetCorpEntityEndpoint(bool useWSDL=false, AnsiString addr="");



#endif // __CorpEntityService_h__

}; // NS_CorpEntityService

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

谁能讲解一下。我该怎么调用里边的方法。该用什么控件。怎么调用。谢谢。
...全文
916 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
亮灯了 2007-04-09
  • 打赏
  • 举报
回复
1、在要调用的类中声明一个全局的_di_CorpEntityEndpoint对像
2、在调用前,实现你的接口_di_CorpEntityEndpoint对像
编译失败 2007-03-30
  • 打赏
  • 举报
回复
看看头文件里定义了什么方法?包含后直接调用就行了,不需要控件
befree 2007-03-29
  • 打赏
  • 举报
回复
李维有本书,用cb做soa的,去看看吧.
CruelYoung123 2007-03-29
  • 打赏
  • 举报
回复
web service用什么写... 觉得参数用简单类型. 不要用结构体传
CruelYoung123 2007-03-29
  • 打赏
  • 举报
回复
我加了你QQ..

你跟踪一下.. 估计是参数的问题..

HTTPRIORoom utf-8设为true
yshff 2007-03-29
  • 打赏
  • 举报
回复
请你务必帮帮我啊。时间非常紧。老大催得十分紧。
yshff 2007-03-29
  • 打赏
  • 举报
回复
HTTPRIORoom THTTPRIO  需不需要设置什么参数啊?
yshff 2007-03-29
  • 打赏
  • 举报
回复
_di_CorpEntityEndpoint tempWS;
tempWS = GetCorpEntityEndpoint();
HTTPRIORoom->QueryInterface(tempWS);
//HTTPRIORoom是 THTTPRIO类型... 是一控件. 在WebSerives标签中

AnsiString te;
User *us;

te="123456";
us->password=te;

te="黄发元";
us->userName=te;


CorpEntityWSParamDTO * ot;
ot->personCode=7343371;
ot->cardNo="123456";
ot->personName="丁家荣";

tempWS->getCorpEntity(us,ot);

为何执行不了啊??
能告诉我你的QQ吗?
CruelYoung123 2007-03-29
  • 打赏
  • 举报
回复
如果返回是dateset

可以在THTTPRIO的AfterExecute事件中处理
CruelYoung123 2007-03-29
  • 打赏
  • 举报
回复

_di_CorpEntityEndpoint tempWS;
tempWS = GetCorpEntityEndpoint();
HTTPRIORoom->QueryInterface(tempWS);
//HTTPRIORoom是 THTTPRIO类型... 是一控件. 在WebSerives标签中
tempWS->getCorpEntity(); //里面的方法,你这里好像也只有这么一个方法
daily66 2007-03-28
  • 打赏
  • 举报
回复
忘了,帮顶一下
daily66 2007-03-28
  • 打赏
  • 举报
回复
没用过BC搞WEB

1,317

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 网络及通讯开发
社区管理员
  • 网络及通讯开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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