Ver Mensaje Individual
  #11  
Antiguo 04-08-2015
adripugliesso adripugliesso is offline
Miembro
NULL
 
Registrado: jul 2015
Posts: 49
Reputación: 0
adripugliesso Va por buen camino
Otros Detalles

Para los que usen webservice importando el WSDL

Forma de llamar a un método, en este caso (FEParamGetTiposDoc):
Código Delphi [-]
procedure TForm1.Button5Click(Sender: TObject);
var
  FEAuth : FEAuthRequest;
  x : Integer;
  s: DocTipoResponse;
  WS: ServiceSoap;
begin
  screen.Cursor := crHourGlass;

  WS := GetServiceSoap(false,'', httprio1);

  FEAuth  := FEAuthRequest.Create;
  try
    FEAuth.Token := token;
    FEAuth.Sign  := sign;
    FEAuth.Cuit  := cuit;

    Memo1.Clear;

    s := WS.FEParamGetTiposDoc(FEAuth);

    if (Length(s.ResultGet) > 0) then
    begin
      for x := 0 to high( s.ResultGet ) do
      Memo1.lines.Add(
        INTTOSTR(s.ResultGet[x].id)+' || '+
        s.ResultGet[x].Desc+' || '+
        s.ResultGet[x].FchDesde+' || '+
        s.ResultGet[x].FchHasta );
     end;

      if (Length(s.Errors) > 0) then
      showmessage(s.Errors[0].Msg);

  finally
    FEAuth.Free;
    s.Free;
  end;
  screen.Cursor := crDefault;
end;
Lo importante en esto es agregar en el componente HTTPRIO:
Código Delphi [-]
procedure TForm1.HTTPRIO1AfterExecute(const MethodName: String;
  SOAPResponse: TStream);
var
  texto : String;
   f: Integer;
   sl: TStringList;
begin
   SoapResponse.Position := 0;
   f:= FileCreate('after.xml');
   sMemo1.lines.add('===========  AFTER EXECUTE  =====================');
   setlength( texto, SOAPResponse.size );
   soapResponse.Read(Texto[1], SOAPResponse.Size);
   smemo1.lines.add( Texto );
   smemo1.lines.add('----------------------------------------------');
   sMemo1.lines.add( MethodName );
   smemo1.lines.add('======== FIN AFTER EXECUTE ======================');

   FileWrite(f, texto[1], Length(texto));
   FileClose(f);

   sl := TStringList.Create;
   try
     sl.Text := Texto;
     sl.SaveToFile('after-sl.xml');
   finally
     sl.Free;
   end;

end;

Última edición por Casimiro Notevi fecha: 05-08-2015 a las 00:15:59.
Responder Con Cita