使用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'类型获取正确的类型参数?
答案 0 :(得分:3)
我使用的是Delphi 7.我遇到了类似的问题。我下载了更新导入程序WSDL和WebService / SOAP运行时。此更新与D2007,D7,D2005和D2006兼容:
http://cc.embarcadero.com/Item/24535
如果您需要更多详细信息,请参阅我的博客。用西班牙语,抱歉: http://www.3engine.net/wp/2010/02/invocando-un-servicio-web-wcf-desde-delphi-7