使用 Delphi 2005,我从这里导入 WSDL:https ://certtransaction.elementexpress.com/express.asmx?wsdl
当我导入此 WSDL 时,其中一种类型是“TransactionSetup”,它没有正确导入。根据文档“TransactionSetup”应具有以下内容:
<s:complexType name="TransactionSetup">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="TransactionSetupID" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="TransactionSetupAccountID" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="TransactionSetupAcceptorID" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="TransactionSetupApplicationID" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="TransactionSetupApplicationName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="TransactionSetupApplicationVersion" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="TransactionSetupMethod" type="tns:TransactionSetupMethod"/>
<s:element minOccurs="1" maxOccurs="1" name="Device" type="tns:Device"/>
<s:element minOccurs="1" maxOccurs="1" name="Embedded" type="tns:BooleanType"/>
<s:element minOccurs="1" maxOccurs="1" name="CVVRequired" type="tns:BooleanType"/>
<s:element minOccurs="1" maxOccurs="1" name="AutoReturn" type="tns:BooleanType"/>
<s:element minOccurs="0" maxOccurs="1" name="CompanyName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="LogoURL" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Tagline" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="WelcomeMessage" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ReturnURL" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ReturnURLTitle" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="OrderDetails" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ProcessTransactionTitle" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ValidationCode" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="DeviceInputCode" type="tns:DeviceInputCode"/>
</s:sequence>
</s:complexType>
我得到的是:
// ************************************************************************ //
// Namespace : https://transaction.elementexpress.com
// ************************************************************************ //
TransactionSetup = class(TRemotable)
private
Fcredentials: Credentials;
Fapplication: Application;
Fterminal: Terminal;
Ftransaction: Transaction;
FtransactionSetup: TransactionSetup;
Faddress: Address;
FpaymentAccount: PaymentAccount;
FextendedParameters: ArrayOfExtendedParameters;
public
destructor Destroy; override;
published
property credentials: Credentials read Fcredentials write Fcredentials;
property application: Application read Fapplication write Fapplication;
property terminal: Terminal read Fterminal write Fterminal;
property transaction: Transaction read Ftransaction write Ftransaction;
property transactionSetup: TransactionSetup read FtransactionSetup write FtransactionSetup;
property address: Address read Faddress write Faddress;
property paymentAccount: PaymentAccount read FpaymentAccount write FpaymentAccount;
property extendedParameters: ArrayOfExtendedParameters read FextendedParameters write FextendedParameters;
end;
我发现的一件事是,有一个方法和一个类型都名为“TransactionSetup”,并且导入器似乎以某种方式将方法的参数捕获为类型参数。这是导入的方法:
ExpressSoap = interface(IInvokable)
['{83D77575-DBDE-3A05-D048-60B2F6BCDFE6}']
procedure TransactionSetup(const credentials: Credentials; const application: Application; const terminal: Terminal; const transaction: Transaction; const transactionSetup: TransactionSetup; const address: Address; const paymentAccount: PaymentAccount; const extendedParameters: ArrayOfExtendedParameters; out response: Response); stdcall;
有没有办法让进口商获得“TransactionSetup”类型的正确类型参数?