Ver Mensaje Individual
  #3550  
Antiguo Hace 2 Semanas
Avatar de keys
keys keys is offline
Miembro
 
Registrado: sep 2003
Ubicación: Bilbao
Posts: 1.034
Reputación: 22
keys Va por buen camino
Esta es la función que tengo para el envío. Nosotros optamos por poner el WSDL a false, para evitar cambios en versiones o que los de hacienda al liado alguna. Ya dará el error al enviar que eso si lo tenemos controlado.

Código Delphi [-]
function GetsiiSOAP(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): siiSOAP;
var
  RIO: THTTPRIO;
  defWSDL : string;
  defURL  : string;
  defSvc : string;
  defPrt : string;
begin

  if EntornoPruebas then
    begin //Pruebas                       
      defWSDL := 'https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/ssii/fact/ws/SuministroFactEmitidas.wsdl';
      defURL  := 'https://prewww1.aeat.es/wlpl/SSII-FACT/ws/fe/SiiFactFEV1SOAP';
      defSvc  := 'siiService';
      defPrt  := 'SuministroFactEmitidasPruebas';
      UseWSDL := false;
    end
  else
     begin //Produccion
       defWSDL := 'https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/ssii/fact/ws/SuministroFactEmitidas.wsdl';
       defURL  := 'https://www1.agenciatributaria.gob.es/wlpl/SSII-FACT/ws/fe/SiiFactFEV1SOAP';
       defSvc  := 'siiService';
       defPrt  := 'SuministroFactEmitidas';
       UseWSDL := false;
     end;
  


  Result := nil;


  if (Addr = '') then
  begin
    if UseWSDL then
     begin
      Addr := defWSDL;

     end
    else
     begin
      Addr := defURL;
     end;
  end;

  if HTTPRIO = nil then
    RIO := THTTPRIO.Create(nil)
  else
    RIO := HTTPRIO;
  try
    Result := (RIO as siiSOAP);
    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;
Responder Con Cita