Open (TbpConnection)

De Wiki1000
function Open:Integer;

Cette méthode ouvre la session sur le serveur de processus métiers.

Paramètre Usage
Result Valeur de retour de la fonction

Valeur de retour :

  • 0
La connexion à réussi
  • <>0
La connexion à échouée
Code Raison
1 Engine not found
2 Host not found (TbpHost not found, see HostName and HostServiceName combinaison, case sensistive)
3 Cmd not supported
4 Not exists
5 Process not found
6 Local host not found
7 Host not running
8 Exception
9 Connect failed (see UserName, Password)


Exemple :

//Procedure EngineInfo;
var bpc:TbpConnection; rslt:integer; doc:TxmlDocument; S:string;
begin
  bpc := TbpConnection.Create;
  bpc.HostName := 'pc100xxx';
  bpc.HostServiceName := 'syfre';
  bpc.UserName := 'syfre';
  bpc.Password := 'syfre';
  rslt := bpc.Open;
  if rslt<>0 then
   begin
     showMessage(Format('Connect Failed :%d',[rslt]));
     exit;
   end;
 
  rslt := bpc.EngineInfo('syfre1',doc);
  if rslt=0 then
     begin
       if Assigned(doc)
          then S := doc.SaveToString
          else S := 'doc not set';
       showMessage(Format('OK: %s',[S]));
     end
     else showMessage(Format('Failed :%d',[rslt]));
 
  Result := FALSE;
end;

TbpConnection (class)Développement DSM





Whos here now:   Members 0   Guests 0   Bots & Crawlers 1
 
Outils personnels