Bonjour,
Mon projet consiste à utiliser l’envoi de documents via WebService (Esker on Demand).
D’après la documentation fournie sur internet (prévue pour le C#), il faut :
Step 1 - Global initializations: Helper functions, particularly the CreateValue function which will be used to set the properties of the media through which the document will be sent
Step 2 - Initialization and authentication: Done in four mandatory steps:
- Instantiate a SessionService object.
- Retrieve the Web service bindings (which contains the proper URLs to associate with each instantiated service).
- Associate the proper URL of the binding to the instantiated service.
- Log on the server
Example (C#) :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 ODSession.SessionService session_service = new ODSession.SessionService(); ODSession.BindingResult bindings = session_service.GetBindings("user"); // Important: initialize Session service with binding URL session_service.Url = bindings.sessionServiceLocation; ODSession.LoginResult authenticatedSession = session_service.Login("user","pass");
Cependant, j'utilise le logiciel Windev pour la programmation informatique.
Après avoir importé le WebService dans mon projet (voir la pièce jointe), je tente donc d’adapter le code à mon environnement.
Ce qui donne (Windev) :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 session_service est un SessionService // renvoie l'erreur : Le type SessionService est inconnu. bindings est un BindingResult = GetBindings(c_User) session_service.Url = bindings.sessionServiceLocation // bindings.sessionServiceLocation contient bien une URL correcte LoginSession est un LoginResult = session_service.Login(c_User, c_Mdp)
J'ai donc 2 problèmes :
1- je ne peux instancier un objet "SessionService" (Erreur : Le type SessionService est inconnu)
2- du coup, je ne peux utiliser ni "session_service.Url" ni "session_service.Login()"
Note : si je n'instancie pas d'objet SessionService, j'obtiens :
Mais l'ID de session est toujours vide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 bindings est un BindingResult = GetBindings(c_User) // OK monUrl est une chaîne = bindings.sessionServiceLocation // OK : contient bien une URL correcte LoginSession est un LoginResult = Login(c_User, c_Mdp) // pas d'erreur Info(LoginSession.sessionID) // Affichage de lID de la session : vide
Normal, car je pense que la méthode Login() a besoin de l'URL récupérée par GetBindings() pour renvoyer une valeur correcte.
(je précise que les c_User et c_Mdp sont bons).
Je sollicite donc votre aide afin d’avoir quelques indications sur la bonne marche à suivre.
Merci d’avance.
Partager