Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 11-01-2024
Avatar de ramherfer
ramherfer ramherfer is offline
Miembro
 
Registrado: may 2013
Ubicación: Valencia
Posts: 51
Poder: 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
  #2  
Antiguo 11-01-2024
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.286
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cita:
Empezado por ramherfer Ver Mensaje
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!

He probado a importarlo con una versión antigua de Delphi (la 7 precisamente) que tenía en una máquina virtual y me genera lo mismo que a ti.
Aunque Delphi no deja de sorprenderme.
Los ficheros generados con las nuevas versiones se pueden "retorcar" para que compilen con Delphi 7 sinmuchos problemas. Incluso el código anterior que genera el XML también se puede ejecutar sin mayores problemas.


Parece mentira que con una versión de hace 20 años se pueda hacer esto.

Eso si, al ejecutar el código falla con el siguiente error:





El cual veo más complicado, porque me parece que las estructuras generadas son demasiado complejas para esa versión.
Como te he comentado en privado, tal vez tendrás que optar con generar una DLL/BPL con una versión más nueva de Delphi (que no tenga 20 años ) y llamarla desde tu aplicación de delphi 7.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Hijo de Informáticos gluglu Humor 3 13-03-2007 11:05:35
Adictos informaticos ... Trigger Humor 2 11-10-2004 12:18:32
Nosotros los Informáticos Trigger Humor 1 10-10-2004 14:58:09
Patrón de los Informáticos. obiwuan Varios 20 10-09-2003 14:44:54
Chistes Informaticos jhonny Humor 2 11-08-2003 21:59:09


La franja horaria es GMT +2. Ahora son las 16:15:08.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi