2011-04-12 133 views
0

我有一个WSDL WSDL导入问题,我试图将其导入Delphi 7中,但我得到了一个消息用Delphi 7

// ************************************************************************ // 
// The types declared in this file were generated from data read from the 
// WSDL File described below: 
// WSDL  : http://201.155.181.40:59080/axis2/services/TimbradorIntegradores?wsdl 
// Encoding : UTF-8 
// Version : 1.0 
// (12/04/2011 08:57:28 a.m. - 1.33.2.5) 
// ************************************************************************ // 

unit TimbradorIntegradores; 

interface 

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns; 

type 

    // ************************************************************************ // 
    // 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. 
    // ************************************************************************ // 




implementation 

initialization 

end. 

我读到一些事情,很多人说,这是为德尔福的版本,我正在与德尔福7,他们说,在德尔福10可能做到这一点,有人知道一些关于它?

由于提前, 最好的问候

回答

2

下面就是德尔福XE做的吧。

我认为它可以在Delphi 7中编译,让我们知道它是否。

// ************************************************************************ // 
// The types declared in this file were generated from data read from the 
// WSDL File described below: 
// WSDL  : http://201.155.181.40:59080/axis2/services/TimbradorIntegradores?wsdl 
// >Import : http://201.155.181.40:59080/axis2/services/TimbradorIntegradores?wsdl>0 
// Encoding : UTF-8 
// Version : 1.0 
// (4/12/2011 4:32:56 PM - - $Rev: 34800 $) 
// ************************************************************************ // 

unit TimbradorIntegradores; 

interface 

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns; 

const 
    IS_OPTN = $0001; 
    IS_NLBL = $0004; 
    IS_REF = $0080; 


type 

    // ************************************************************************ // 
    // 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 Embarcadero types; however, they could also 
    // indicate incorrect WSDL documents that failed to declare or import a schema type. 
    // ************************************************************************ // 
    // !:string   - "http://www.w3.org/2001/XMLSchema"[Gbl] 
    // !:anyType   - "http://www.w3.org/2001/XMLSchema"[Gbl] 

    Exception2   = class;     { "http://integradores.cfdi.mx.konesh.com"[GblCplx] } 
    Exception   = class;     { "http://integradores.cfdi.mx.konesh.com"[Flt][GblElm] } 



    // ************************************************************************ // 
    // XML  : Exception, global, <complexType> 
    // Namespace : http://integradores.cfdi.mx.konesh.com 
    // ************************************************************************ // 
    Exception2 = class(TRemotable) 
    private 
    FException: Variant; 
    FException_Specified: boolean; 
    procedure SetException(Index: Integer; const AVariant: Variant); 
    function Exception_Specified(Index: Integer): boolean; 
    published 
    property Exception: Variant Index (IS_OPTN or IS_NLBL) read FException write SetException stored Exception_Specified; 
    end; 



    // ************************************************************************ // 
    // XML  : Exception, global, <element> 
    // Namespace : http://integradores.cfdi.mx.konesh.com 
    // Info  : Fault 
    // ************************************************************************ // 
    Exception = class(ERemotableException) 
    private 
    FException: Exception2; 
    FException_Specified: boolean; 
    procedure SetException(Index: Integer; const AException2: Exception2); 
    function Exception_Specified(Index: Integer): boolean; 
    public 
    destructor Destroy; override; 
    published 
    property Exception: Exception2 Index (IS_OPTN or IS_NLBL) read FException write SetException stored Exception_Specified; 
    end; 


    // ************************************************************************ // 
    // Namespace : http://integradores.cfdi.mx.konesh.com 
    // soapAction: urn:get 
    // transport : http://schemas.xmlsoap.org/soap/http 
    // style  : document 
    // use  : literal 
    // binding : TimbradorIntegradoresSoap12Binding 
    // service : TimbradorIntegradores 
    // port  : TimbradorIntegradoresHttpSoap12Endpoint 
    // URL  : http://201.155.181.40:59080/axis2/services/TimbradorIntegradores.TimbradorIntegradoresHttpSoap12Endpoint/ 
    // ************************************************************************ // 
    TimbradorIntegradoresPortType = interface(IInvokable) 
    ['{85D3323D-9BEE-180B-C748-39D139E150FE}'] 
    function get(const cad: string; const tk: string; const user: string; const pass: string; const cuenta: string): string; stdcall; 
    end; 

function GetTimbradorIntegradoresPortType(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): TimbradorIntegradoresPortType; 


implementation 
    uses SysUtils; 

function GetTimbradorIntegradoresPortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): TimbradorIntegradoresPortType; 
const 
    defWSDL = 'http://201.155.181.40:59080/axis2/services/TimbradorIntegradores?wsdl'; 
    defURL = 'http://201.155.181.40:59080/axis2/services/TimbradorIntegradores.TimbradorIntegradoresHttpSoap12Endpoint/'; 
    defSvc = 'TimbradorIntegradores'; 
    defPrt = 'TimbradorIntegradoresHttpSoap12Endpoint'; 
var 
    RIO: THTTPRIO; 
begin 
    Result := nil; 
    if (Addr = '') then 
    begin 
    if UseWSDL then 
     Addr := defWSDL 
    else 
     Addr := defURL; 
    end; 
    if HTTPRIO = nil then 
    RIO := THTTPRIO.Create(nil) 
    else 
    RIO := HTTPRIO; 
    try 
    Result := (RIO as TimbradorIntegradoresPortType); 
    if UseWSDL then 
    begin 
     RIO.WSDLLocation := Addr; 
     RIO.Service := defSvc; 
     RIO.Port := defPrt; 
    end else 
     RIO.URL := Addr; 
    finally 
    if (Result = nil) and (HTTPRIO = nil) then 
     RIO.Free; 
    end; 
end; 


procedure Exception2.SetException(Index: Integer; const AVariant: Variant); 
begin 
    FException := AVariant; 
    FException_Specified := True; 
end; 

function Exception2.Exception_Specified(Index: Integer): boolean; 
begin 
    Result := FException_Specified; 
end; 

destructor Exception.Destroy; 
begin 
    SysUtils.FreeAndNil(FException); 
    inherited Destroy; 
end; 

procedure Exception.SetException(Index: Integer; const AException2: Exception2); 
begin 
    FException := AException2; 
    FException_Specified := True; 
end; 

function Exception.Exception_Specified(Index: Integer): boolean; 
begin 
    Result := FException_Specified; 
end; 

initialization 
    { TimbradorIntegradoresPortType } 
    InvRegistry.RegisterInterface(TypeInfo(TimbradorIntegradoresPortType), 'http://integradores.cfdi.mx.konesh.com', 'UTF-8'); 
    InvRegistry.RegisterDefaultSOAPAction(TypeInfo(TimbradorIntegradoresPortType), 'urn:get'); 
    InvRegistry.RegisterInvokeOptions(TypeInfo(TimbradorIntegradoresPortType), ioDocument); 
    InvRegistry.RegisterInvokeOptions(TypeInfo(TimbradorIntegradoresPortType), ioSOAP12); 
    { TimbradorIntegradoresPortType.get } 
    InvRegistry.RegisterMethodInfo(TypeInfo(TimbradorIntegradoresPortType), 'get', '', 
           '[ReturnName="return"]', IS_OPTN or IS_NLBL); 
    InvRegistry.RegisterParamInfo(TypeInfo(TimbradorIntegradoresPortType), 'get', 'cad', '', 
           '', IS_NLBL); 
    InvRegistry.RegisterParamInfo(TypeInfo(TimbradorIntegradoresPortType), 'get', 'tk', '', 
           '', IS_NLBL); 
    InvRegistry.RegisterParamInfo(TypeInfo(TimbradorIntegradoresPortType), 'get', 'user', '', 
           '', IS_NLBL); 
    InvRegistry.RegisterParamInfo(TypeInfo(TimbradorIntegradoresPortType), 'get', 'pass', '', 
           '', IS_NLBL); 
    InvRegistry.RegisterParamInfo(TypeInfo(TimbradorIntegradoresPortType), 'get', 'cuenta', '', 
           '', IS_NLBL); 
    InvRegistry.RegisterParamInfo(TypeInfo(TimbradorIntegradoresPortType), 'get', 'return', '', 
           '', IS_NLBL); 
    RemClassRegistry.RegisterXSClass(Exception2, 'http://integradores.cfdi.mx.konesh.com', 'Exception2', 'Exception'); 
    RemClassRegistry.RegisterXSClass(Exception, 'http://integradores.cfdi.mx.konesh.com', 'Exception'); 

end. 
3

从D2007的WSDL进口商是available早期版本的Delphi(D7,D2005和D2006)的用户。你有没有使用这个WSDL导入器的更新版本?