Ver Mensaje Individual
  #1104  
Antiguo 11-01-2024
Avatar de ramherfer
ramherfer ramherfer is offline
Miembro
 
Registrado: may 2013
Ubicación: Valencia
Posts: 51
Reputación: 11
ramherfer Va por buen camino
Hola buenos días. Por favor, alquien a conseguido importar lo wsdl con Delphi 7. Lo he intentado con el WSDL Importer, pero me genera un fichero de pocas lineas y creo que no es correcto. ¡Gracias!
Código:
unit SistemaFacturacion;

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.
  // ************************************************************************ //
  // !:AltaFactuSistemaFacturacion - "https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SuministroLR.xsd"
  // !:RespuestaAltaFactuSistemaFacturacion - "https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/RespuestaSuministro.xsd"
  // !:BajaFactuSistemaFacturacion - "https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SuministroLR.xsd"
  // !:RespuestaBajaFactuSistemaFacturacion - "https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/RespuestaSuministro.xsd"


  // ************************************************************************ //
  // Namespace : https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SistemaFacturacion.wsdl
  // transport : http://schemas.xmlsoap.org/soap/http
  // style     : document
  // binding   : sfBinding
  // service   : sfService
  // port      : SistemaFacturacion
  // URL       : xxxxxxxxxx
  // ************************************************************************ //
  sfSOAP = interface(IInvokable)
  ['{20282F52-013C-FB3F-C901-1B37EB939FA1}']
    function  AltaFactuSistemaFacturacion(const AltaFactuSistemaFacturacion: AltaFactuSistemaFacturacion): RespuestaAltaFactuSistemaFacturacion; stdcall;
    function  BajaFactuSistemaFacturacion(const BajaFactuSistemaFacturacion: BajaFactuSistemaFacturacion): RespuestaBajaFactuSistemaFacturacion; stdcall;
  end;

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


implementation

function GetsfSOAP(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): sfSOAP;
const
  defWSDL = 'Y:\Ramiro\Escritorio\VERIFACTU\FORMATOS-0.4\SistemaFacturacion.wsdl';
  defURL  = 'xxxxxxxxxx';
  defSvc  = 'sfService';
  defPrt  = 'SistemaFacturacion';
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 sfSOAP);
    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;


initialization
  InvRegistry.RegisterInterface(TypeInfo(sfSOAP), 'https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SistemaFacturacion.wsdl', 'UTF-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(sfSOAP), '');
  InvRegistry.RegisterInvokeOptions(TypeInfo(sfSOAP), ioDocument);
  InvRegistry.RegisterInvokeOptions(TypeInfo(sfSOAP), ioLiteral);

end.
__________________
Se humilde para admitir tus errores, inteligente para aprender de ellos y maduro para corregirlos.
Responder Con Cita