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

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 : 676
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