Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
call to SOAP not work
#1
HI,

I need to call a function on a SOAP server. this is the code. I receive an error as a response ('' is not valid integer value) - error delphi. - look at the WSDL attachment imported from delphi

thanks
Alessandro Romano

this is the procedure:

Code:
var
  sDProt : AggiuntaRequestData;
  sRisposta : AggiuntaResponseData;
  ArraybyteSOAP, FileArrayByteSOAP : TByteSOAPArray;
  Base64: TBase64Encoding;
  TFilePrincipale : FileType;
  s : string;
begin
  // creo strutture
  sDprot := AggiuntaRequestData.Create;
  sRisposta := AggiuntaResponseData.Create;
  TFilePrincipale := FileType.Create;
  // ******

  // operatore e password
  sDprot.operatore := 'XXX';
  sDprot.password := 'YYY';
  // ******

  // file principale - Encoded in BASE64 e poi convertito in TByteSOAPArray
  FileArrayByteSOAP := TByteSOAPArray(TEncoding.UTF8.GetBytes(EncodeFile('c:\temp\prova1.pdf')));
  TFilePrincipale.NomeFile := 'prova1.pdf';
  TFilePrincipale.CidFile := FileArrayByteSOAP;

  // assegno struttura creata
  sDProt.filePrincipale := TFilePrincipale;
  // ****

  // segnature - Encoded in BASE64 e poi convertito in TByteSOAPArray
  s := EParametro.Text;
  Base64 := TBase64Encoding.Create;
  // converto in base64
  s := Base64.Encode(s);
  // converto in TByteSOAPArray
  ArraybyteSOAP := TByteSOAPArray(TEncoding.UTF8.GetBytes(s));

  sDProt.segnatura := ArraybyteSOAP;
  //******

  // chiamata al soap per nuovo protocollo - qui avviene errore su NuovoProtocollo
  sRisposta := (HTTPRIO1 as filedepot).NuovoProtocollo(sDProt); // <- ERROR


  // lettura eventuale risposta risposta
  Memo2.Lines.Add('Anno: ' +sRisposta.anno.ToString );
  Memo2.Lines.Add('Protocollo: ' + sRisposta.numero.ToString);
  Memo2.Lines.Add('Identificativo: ' + sRisposta.idProto.ToString);
  Memo2.Lines.Add('CodErrore: '+ sRisposta.coderrore.ToString);
  Memo2.Lines.Add('DescErrore: ' + sRisposta.deserrore);

  // free strutture
  sDProt.Free;
  sRisposta.Free;
  TFilePrincipale.Free;
  Base64.Free;


Attached Files
.zip   PIWSMAIN.zip (Size: 2.41 KB / Downloads: 0)
Reply
#2
(10-23-2023, 04:51 PM)staff@ergosoft.it Wrote: I need to call a function on a SOAP server. this is the code. I receive an error as a response ('' is not valid integer value) - error delphi. - look at the WSDL attachment imported from delphi

How is this related to Indy? Probably should have been posted in a general Delphi forum instead.

Reply
#3
OK thank you.

I was hoping for some help here Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)