IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

C++Builder Discussion :

développer un "client" en C++ pour un service web existant


Sujet :

C++Builder

Vue hybride

dibak développer un "client" en C++... 14/07/2019, 01h47
DjmSoftware salut pour pouvoir t'aider... 14/07/2019, 10h55
dibak Salut DjmSoftware, Je te... 14/07/2019, 14h10
DjmSoftware après passage à la moulinette... 15/07/2019, 13h54
dibak Salut DjmSoftware, Merci... 16/07/2019, 10h44
Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Août 2003
    Messages
    121
    Détails du profil
    Informations forums :
    Inscription : Août 2003
    Messages : 121
    Par défaut développer un "client" en C++ pour un service web existant
    salut,
    je voudrais une aide s'il vous plait, voici mon problème:
    Une société a mis en place un service web dans lequel, elle expose la méthode EnvoyerPRT().
    Et moi j’ai conçu une application qui doit utiliser (je voudrais utiliser ou invoquer ou appeller) ladite méthode EnvoyerPRT().
    Le problème revient à développer un "client" en C++ pour un service web existant (dont je ne suis pas propriétaire).

    Question : Suis-je dans un cas d’utilisation de gSOAP ?

    je pourrais donner plus de détail de compréhension en cas de nécessité
    Je vous en prie je suis débutant dans le web service, je sollicite votre indulgence.

    Dibak

  2. #2
    Membre Expert
    Avatar de DjmSoftware
    Homme Profil pro
    Responsable de compte
    Inscrit en
    Mars 2002
    Messages
    1 044
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Suisse

    Informations professionnelles :
    Activité : Responsable de compte
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2002
    Messages : 1 044
    Billets dans le blog
    1
    Par défaut
    salut
    pour pouvoir t'aider j'aurais besoin de plus d'information sur ce serviceWeb
    l'URL serait déja un bon début.
    je te conseille par contre de porter ton application vers la dernière version de C++ Builder
    cordialement
    vous trouverez mes tutoriels à l'adresse suivante: http://djmsoftware.developpez.com/
    je vous en souhaite une excellente lecture ...

    A lire : Les règles du forum

  3. #3
    Membre confirmé
    Inscrit en
    Août 2003
    Messages
    121
    Détails du profil
    Informations forums :
    Inscription : Août 2003
    Messages : 121
    Par défaut
    Citation Envoyé par DjmSoftware Voir le message
    salut
    pour pouvoir t'aider j'aurais besoin de plus d'information sur ce serviceWeb
    l'URL serait déja un bon début.
    je te conseille par contre de porter ton application vers la dernière version de C++ Builder
    cordialement
    Salut DjmSoftware,
    Je te remercie pour ta disponibilité à m'apporter un coup de main
    voici comme demandé l'URL: http://41.204.94.29:8282/Managesms-war/ServiceSMS?WSDL

    La méthode de leur web service que je voudrais utiliser s'appelle “EnvoyerSMS()” .
    cette méthode « envoyerSMS » comprend les étapes suivantes:
    1. Lecture des valeurs passées en paramètres ;
    2. Vérification de l’identité de l’utilisateur ;
    3. Vérification du nombre de crédit de l’utilisateur ;
    4. Envoi de SMS proprement dit.

    Les paramètres de la méthode
    Il est possible pour les clients d’obtenir la liste des paramètres via l’URL :
    http:// lmtgoldsms.dyndns.org:8282/Managesms-war/ServiceSMS?xsd=1

    Les paramètres de la méthode « envoyerSMS » du service web sont les suivants :

    userLogoin chaine
    userpassword chaine (Mot de passe de l’utilisateur.)
    destinataires Tableau de chaine (Liste de numéro de téléphones)
    messages chaine (Contenu du SMS à envoyer
    la taille étant fixée à 160 caractères.)
    numeroCourt chaine (SENDER ID du client)

    Problème: Mon application écrite dans c++ souhaite utiliser la méthode "EnvoyerSMS()" ci-dessus décrite.
    Je suis sur la piste de vouloir utiliser gSOAP, est-ce bien réfléchi?

  4. #4
    Membre Expert
    Avatar de DjmSoftware
    Homme Profil pro
    Responsable de compte
    Inscrit en
    Mars 2002
    Messages
    1 044
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Suisse

    Informations professionnelles :
    Activité : Responsable de compte
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2002
    Messages : 1 044
    Billets dans le blog
    1
    Par défaut
    après passage à la moulinette voici les fichiers générés par l'expert WSDL

    le .H
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
     
    // ************************************************************************ //
    // Les types déclarés dans ce fichier ont été générés à partir de données lues
    // depuis le fichier WSDL décrit ci-dessous :
    // WSDL     : http://41.204.94.29:8282/Managesms-war/ServiceSMS?WSDL
    //  >Importer : http://41.204.94.29:8282/Managesms-war/ServiceSMS?WSDL>0
    //  >Importer : http://41.204.94.29:8282/Managesms-war/ServiceSMS?xsd=1
    //  >Importer : http://41.204.94.29:8282/Managesms-war/ServiceSMS?xsd=2
    //  >Importer : http://41.204.94.29:8282/Managesms-war/ServiceSMS?WSDL>1
    // Encodage : UTF-8
    // Version  : 1.0
    // (15.07.2019 12:48:04 - - $Rev: 25127 $)
    // ************************************************************************ //
     
    #ifndef   ServiceSMSH
    #define   ServiceSMSH
     
    #include <System.hpp>
    #include <InvokeRegistry.hpp>
    #include <XSBuiltIns.hpp>
    #include <SOAPHTTPClient.hpp>
     
    #if !defined(SOAP_REMOTABLE_CLASS)
    #define SOAP_REMOTABLE_CLASS __declspec(delphiclass)
    #endif
    #if !defined(IS_OPTN)
    #define IS_OPTN 0x0001
    #endif
    #if !defined(IS_UNBD)
    #define IS_UNBD 0x0002
    #endif
    #if !defined(IS_NLBL)
    #define IS_NLBL 0x0004
    #endif
    #if !defined(IS_UNQL)
    #define IS_UNQL 0x0008
    #endif
     
     
    namespace NS_ServiceSMS {
     
    // ************************************************************************ //
    // Les types suivants mentionnés dans le document WSDL ne sont pas représentés
    // dans ce fichier. Ce sont des alias[@] d'autres types représentés ou alors ils étaient référencés
    // mais jamais[!] déclarés dans le document. Les types de la dernière catégorie
    // sont en principe mappés sur des types Embarcadero ou XML prédéfinis/connus. Toutefois, ils peuvent aussi 
    // signaler des documents WSDL incorrects n'ayant pas réussi à déclarer ou importer un type de schéma.
    // ************************************************************************ //
    // !:string          - "http://www.w3.org/2001/XMLSchema"[Gbl]
    // !:base64Binary    - "http://www.w3.org/2001/XMLSchema"[Gbl]
    // !:int             - "http://www.w3.org/2001/XMLSchema"[Gbl]
    // !:boolean         - "http://www.w3.org/2001/XMLSchema"[Gbl]
     
    class SOAP_REMOTABLE_CLASS stringArray;
     
    typedef DynamicArray<UnicodeString> Array_Of_string; /* "http://www.w3.org/2001/XMLSchema"[GblUbnd] */
     
     
    // ************************************************************************ //
    // XML       : stringArray, global, <complexType>
    // Espace de nommage : http://jaxb.dev.java.net/array
    // ************************************************************************ //
    class stringArray : public TRemotable {
    private:
      Array_Of_string Fitem;
      bool            Fitem_Specified;
      void __fastcall Setitem(int Index, Array_Of_string _prop_val)
      {  Fitem = _prop_val; Fitem_Specified = true;  }
      bool __fastcall item_Specified(int Index)
      {  return Fitem_Specified;  } 
     
      int  GetLength() const  { return Fitem.get_length(); }
      void SetLength(int len) { Fitem_Specified = true; Fitem.set_length(len); }
     
    public:
      UnicodeString& operator[](int index) { Fitem_Specified = true; return Fitem[index]; }
      __property int Len = { read=GetLength, write=SetLength };
     
    __published:
      __property Array_Of_string       item = { index=(IS_OPTN|IS_UNBD|IS_NLBL|IS_UNQL), read=Fitem, write=Setitem, stored = item_Specified };
    };
     
     
    typedef DynamicArray<stringArray*> Array_Of_stringArray; /* "http://jaxb.dev.java.net/array"[GblUbnd] */
    typedef DynamicArray<int>         Array_Of_int;   /* "http://www.w3.org/2001/XMLSchema"[GblUbnd] */
     
    // ************************************************************************ //
    // Espace de nommage : http://service.managesms.nexxys.com/
    // transport : http://schemas.xmlsoap.org/soap/http
    // style     : document
    // Liaison : ServiceSMSPortBinding
    // service   : ServiceSMS
    // port      : ServiceSMSPort
    // URL       : http://41.204.94.29:8282/Managesms-war/ServiceSMS
    // ************************************************************************ //
    __interface INTERFACE_UUID("{3F570F04-ADB2-70C1-384C-C693DEB4FB7D}") ServiceSMS : public IInvokable
    {
    public:
      virtual int             changePassword(const UnicodeString userLogin, const UnicodeString userpassword, const UnicodeString newpassword) = 0; 
      virtual TByteDynArray   crypter(const UnicodeString arg0) = 0; 
      virtual UnicodeString   genererPWD() = 0; 
      virtual int             envoyerSMS(const UnicodeString userLogoin, const UnicodeString userpassword, const Array_Of_string destinataires, const UnicodeString messages, const UnicodeString numeroCourt) = 0; 
      virtual int             envoyerSMSAFB(const UnicodeString userLogoin, const UnicodeString userpassword, const Array_Of_string destinataires, const Array_Of_string messages, const UnicodeString numeroCourt) = 0; 
      virtual Array_Of_int    envoyerSMSNew(const UnicodeString userLogoin, const UnicodeString userpassword, const Array_Of_string destinataires, const UnicodeString messages, const UnicodeString numeroCourt) = 0; 
      virtual Array_Of_int    envoyerUnSMS(const UnicodeString userLogoin, const UnicodeString userpassword, const UnicodeString destinataires, const UnicodeString messages, const UnicodeString numeroCourt) = 0; 
      virtual int             consulterSolde(const UnicodeString userLogin, const UnicodeString userpassword) = 0; 
      virtual int             envoyerSMSURL(const UnicodeString arg0, const UnicodeString arg1, const UnicodeString arg2, const UnicodeString arg3, const UnicodeString arg4) = 0; 
      virtual Array_Of_stringArray listContactsUser(const UnicodeString userLogoin, const UnicodeString userpassword) = 0; 
      virtual bool            emailValidator(const UnicodeString arg0) = 0; 
      virtual bool            phoneValidator(const UnicodeString arg0) = 0; 
      virtual UnicodeString   formatTel(const UnicodeString arg0) = 0; 
    };
    typedef DelphiInterface<ServiceSMS> _di_ServiceSMS;
     
    _di_ServiceSMS GetServiceSMS(bool useWSDL=false, AnsiString addr="", THTTPRIO* HTTPRIO=0);
     
     
    };     // NS_ServiceSMS
     
    #if !defined(NO_IMPLICIT_NAMESPACE_USE)
    using  namespace NS_ServiceSMS;
    #endif
     
     
     
    #endif // ServiceSMSH
    et le .CPP
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
     
    // ************************************************************************ //
    // Les types déclarés dans ce fichier ont été générés à partir de données lues
    // depuis le fichier WSDL décrit ci-dessous :
    // WSDL     : http://41.204.94.29:8282/Managesms-war/ServiceSMS?WSDL
    //  >Importer : http://41.204.94.29:8282/Managesms-war/ServiceSMS?WSDL>0
    //  >Importer : http://41.204.94.29:8282/Managesms-war/ServiceSMS?xsd=1
    //  >Importer : http://41.204.94.29:8282/Managesms-war/ServiceSMS?xsd=2
    //  >Importer : http://41.204.94.29:8282/Managesms-war/ServiceSMS?WSDL>1
    // Encodage : UTF-8
    // Version  : 1.0
    // (15.07.2019 12:48:04 - - $Rev: 25127 $)
    // ************************************************************************ //
     
    #include <vcl.h>
    #pragma hdrstop
     
    #if !defined(ServiceSMSH)
    #include "ServiceSMS.h"
    #endif
     
     
     
    namespace NS_ServiceSMS {
     
    _di_ServiceSMS GetServiceSMS(bool useWSDL, AnsiString addr, THTTPRIO* HTTPRIO)
    {
      static const char* defWSDL= "http://41.204.94.29:8282/Managesms-war/ServiceSMS?WSDL";
      static const char* defURL = "http://41.204.94.29:8282/Managesms-war/ServiceSMS";
      static const char* defSvc = "ServiceSMS";
      static const char* defPrt = "ServiceSMSPort";
      if (addr=="")
        addr = useWSDL ? defWSDL : defURL;
      THTTPRIO* rio = HTTPRIO ? HTTPRIO : new THTTPRIO(0);
      if (useWSDL) {
        rio->WSDLLocation = addr;
        rio->Service = defSvc;
        rio->Port = defPrt;
      } else {
        rio->URL = addr;
      }
      _di_ServiceSMS service;
      rio->QueryInterface(service);
      if (!service && !HTTPRIO)
        delete rio;
      return service;
    }
     
     
    // ************************************************************************ //
    // Cette routine enregistre les interfaces et les types exposés par le service Web.
    // ************************************************************************ //
    static void RegTypes()
    {
      /* ServiceSMS */
      InvRegistry()->RegisterInterface(__delphirtti(ServiceSMS), L"http://service.managesms.nexxys.com/", L"UTF-8");
      InvRegistry()->RegisterDefaultSOAPAction(__delphirtti(ServiceSMS), L"");
      InvRegistry()->RegisterInvokeOptions(__delphirtti(ServiceSMS), ioDocument);
      InvRegistry()->RegisterExternalParamName(__delphirtti(ServiceSMS), L"changePassword", L"return_", L"return");
      InvRegistry()->RegisterExternalParamName(__delphirtti(ServiceSMS), L"crypter", L"return_", L"return");
      InvRegistry()->RegisterExternalParamName(__delphirtti(ServiceSMS), L"genererPWD", L"return_", L"return");
      InvRegistry()->RegisterExternalParamName(__delphirtti(ServiceSMS), L"envoyerSMS", L"return_", L"return");
      InvRegistry()->RegisterExternalParamName(__delphirtti(ServiceSMS), L"envoyerSMSAFB", L"return_", L"return");
      InvRegistry()->RegisterExternalParamName(__delphirtti(ServiceSMS), L"envoyerSMSNew", L"return_", L"return");
      InvRegistry()->RegisterExternalParamName(__delphirtti(ServiceSMS), L"envoyerUnSMS", L"return_", L"return");
      InvRegistry()->RegisterExternalParamName(__delphirtti(ServiceSMS), L"consulterSolde", L"return_", L"return");
      InvRegistry()->RegisterExternalParamName(__delphirtti(ServiceSMS), L"envoyerSMSURL", L"return_", L"return");
      InvRegistry()->RegisterExternalParamName(__delphirtti(ServiceSMS), L"listContactsUser", L"return_", L"return");
      InvRegistry()->RegisterExternalParamName(__delphirtti(ServiceSMS), L"emailValidator", L"return_", L"return");
      InvRegistry()->RegisterExternalParamName(__delphirtti(ServiceSMS), L"phoneValidator", L"return_", L"return");
      InvRegistry()->RegisterExternalParamName(__delphirtti(ServiceSMS), L"formatTel", L"return_", L"return");
      /* Array_Of_string */
      RemClassRegistry()->RegisterXSInfo(__delphirtti(Array_Of_string), L"http://www.w3.org/2001/XMLSchema", L"Array_Of_string");
      RemClassRegistry()->RegisterSerializeOptions(__delphirtti(Array_Of_string), (TSerializationOptions() << xoInlineArrays));
      /* stringArray */
      RemClassRegistry()->RegisterXSClass(__classid(stringArray), L"http://jaxb.dev.java.net/array", L"stringArray");
      /* Array_Of_stringArray */
      RemClassRegistry()->RegisterXSInfo(__delphirtti(Array_Of_stringArray), L"http://jaxb.dev.java.net/array", L"Array_Of_stringArray");
      RemClassRegistry()->RegisterSerializeOptions(__delphirtti(Array_Of_stringArray), (TSerializationOptions() << xoInlineArrays));
      /* Array_Of_int */
      RemClassRegistry()->RegisterXSInfo(__delphirtti(Array_Of_int), L"http://www.w3.org/2001/XMLSchema", L"Array_Of_int");
      RemClassRegistry()->RegisterSerializeOptions(__delphirtti(Array_Of_int), (TSerializationOptions() << xoInlineArrays));
    }
    #pragma startup RegTypes 32
     
    };     // NS_ServiceSMS

    tu trouveras un tuto sur l'utilisation des WebServices ici:https://lfe.developpez.com/WebService/BCB/
    Cordialement
    vous trouverez mes tutoriels à l'adresse suivante: http://djmsoftware.developpez.com/
    je vous en souhaite une excellente lecture ...

    A lire : Les règles du forum

  5. #5
    Membre confirmé
    Inscrit en
    Août 2003
    Messages
    121
    Détails du profil
    Informations forums :
    Inscription : Août 2003
    Messages : 121
    Par défaut
    Salut DjmSoftware,
    Merci pour cette aide, je vais essayer de l'analyser bien que de prime abord je n'ai pas vu où utiliser la methode envoyerSMS(), ou mieux comment l'appeller.
    Mais je ne vais pas tout demander, je continue à chercher.

    cordialement
    dibak

  6. #6
    Membre Expert
    Avatar de DjmSoftware
    Homme Profil pro
    Responsable de compte
    Inscrit en
    Mars 2002
    Messages
    1 044
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Suisse

    Informations professionnelles :
    Activité : Responsable de compte
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2002
    Messages : 1 044
    Billets dans le blog
    1
    Par défaut
    Salut très simplement
    dans ton code principal
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    _di_ServiceSMS mService=GetServiceSMS(true,"http://41.204.94.29:8282/Managesms-war/ServiceSMS?WSDL"); // instance du service
    Edit1->Text=mService->genererPWD();    // affichage du mot de passe généré par le service Web
    mService->
    voila tout simplement
    Nom : FunctionServicesSMS.png
Affichages : 666
Taille : 27,5 Ko

    cordialement
    vous trouverez mes tutoriels à l'adresse suivante: http://djmsoftware.developpez.com/
    je vous en souhaite une excellente lecture ...

    A lire : Les règles du forum

Discussions similaires

  1. Client pour un service WEB Sage X3
    Par Papy214 dans le forum Web & réseau
    Réponses: 2
    Dernier message: 20/04/2018, 15h36
  2. Client android pour un service web
    Par cendrine15 dans le forum Services Web
    Réponses: 2
    Dernier message: 04/05/2013, 18h38
  3. style ou designe de page pour mon service web
    Par Nadyr dans le forum Services Web
    Réponses: 3
    Dernier message: 02/08/2011, 00h14
  4. systeme multi agent pour les services web
    Par hadi200 dans le forum Programmation par agent
    Réponses: 0
    Dernier message: 28/03/2009, 13h12
  5. timer pour un service Web
    Par lamine83 dans le forum Services Web
    Réponses: 5
    Dernier message: 17/12/2007, 12h44

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo