I'm using delphi to read a webservice from an insurance company.
It turns out that it comes in XML format in SOAP.
I make the WSDL import get the methods.
But to connect to the Web Service I have to send a token that I do not know how to do in the documentation has an example with wfc strom and it works. I have to create a string type msgheader where I send the token.
Then in the query parameters, I send only the bi and id of the company and it returns me data, before I have to go to the config and put the user, pass and domain to connect to the web service because it is in IIS. >
Delphi code that is not working
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, WSClientes, StdCtrls,
InvokeRegistry, SOAPHTTPClient, opCOnvertOptions, XMLIntf, XSBuiltIns,
Soap.Rio;
type
TForm3 = class(TForm)
Memo1: TMemo;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
{ TSOAPCredentials }
procedure TForm3.Button1Click(Sender: TObject);
var
ws : WSClientes;
Rio : THTTPRIO;
begin
Rio := THttpRIO.Create(nil);
ws := WSClientes (false, '', Rio);
ws :=WSClientes.MlBase2.Create;
ws := WSClientes.GetIWSClientes();
Rio.HTTPWebNode.UserName := 'dominio/user0121';
Rio.HTTPWebNode.UserName := 'password';
Rio.SOAPHeaders.ToString := 'L9+zby7w1V5OZTVGUPLZ1x8rJYzCEHAnxovPUuyadZFdbv21elZ1qsvy';
Rio.SOAPHeaders.Send(Rio);
end;