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
谁能讲解一下。我该怎么调用里边的方法。该用什么控件。怎么调用。谢谢。