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

XML/XSL et SOAP Discussion :

Utilisation d'un service Axis2


Sujet :

XML/XSL et SOAP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2008
    Messages
    34
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2008
    Messages : 34
    Par défaut Utilisation d'un service Axis2
    Bonjour,

    J'ai un problème au niveau de l'utilisation d'Axis2, je m'explique :

    J'ai accès à : http://localhost:8080/axis2/

    Je peux voir le service Version : http://localhost:8080/axis2/services/Version?wsdl

    Seulement d'après les tutos et documentations que j'ai lu je devrais pouvoir récupérer le fichier XML de réponse de ce service.

    Utilisation du service Version : http://localhost:8080/axis2/services...hod=getVersion

    Or cette URL me retourne une erreur :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    <soapenv:Reason>
    <soapenv:Text xml:lang="en-US">
    The endpoint reference (EPR) for the Operation not found is /axis2/services/Version?method=getVersion and the WSA Action = null
    </soapenv:Text>
    </soapenv:Reason>

  2. #2
    Membre Expert
    Avatar de emmanuel.remy
    Inscrit en
    Novembre 2005
    Messages
    2 855
    Détails du profil
    Informations personnelles :
    Âge : 56

    Informations forums :
    Inscription : Novembre 2005
    Messages : 2 855
    Par défaut
    Ton code est valable en v1.
    En V2:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    http://localhost:8080/axis2/services/Version/getVersion
    et
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    http://localhost:8080/axis2/services/monWebService/maMethode?monParametre=maValeur
    pour le tester avec un paramètre

    ERE

  3. #3
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2008
    Messages
    34
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2008
    Messages : 34
    Par défaut
    Merci infiniment je n'ai trouvé cette réponse nul part ailleurs #_#


  4. #4
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2008
    Messages
    34
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2008
    Messages : 34
    Par défaut
    Bonjour,

    Je reviens à l'attaque sur ce sujet, il ne me manque plus que ce point à éclaircir pour finaliser mon projet

    Je créer mon Web service en tant que projet Axis2 sous NetBeans, je le compile et le déploie sans aucune problème.

    Voilà ce que ma structure donne une fois déployé sous Axis2 :



    Mon problème réside dans le teste de celui-ci à partir de l'url :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    http://localhost:8080/axis2/services/NewAxisFromJava/tauxInscriptionService?service=1
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    <soapenv:Reason>
    <soapenv:Text xml:lang="en-US">
    Exception occurred while trying to invoke service method tauxInscriptionService
    </soapenv:Text>
    </soapenv:Reason>
    Et ça pour mes quatre méthodes, je me doute donc qu'il doit y avoir un problème de conception (encore) dans mon code . . .

    J'ai d'abord essayé de générer un client via Netbeans et grâce au drag & drop des méthodes (où le code est généré automatiquement) du Web service mais les erreurs sont les mêmes.

    Ma classe java en question :

    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
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    Code :
     
    package packageWS;
     
    import java.sql.*;
     
    public class NewAxisFromJava
    {
    Connection con;
    static String Driver = "com.mysql.jdbc.Driver";
    static String url = "jdbcmdss[{:mysql:}]//192.168.1.45:3306/base_projet";
    static String login = "damien";
    static String password = "damien";
     
    //-------------------------------------------------------
    // Initialisation du driver OBCD.
    //-------------------------------------------------------
     
    private void Database()
    {
    try
    {
    // Driver JDBC
    Class.forName(Driver);
    }
    catch(Exception e)
    {
    System.out.println("Erreur lors du chargement du driver:"+ e.getMessage());
    }
    }
     
    //-------------------------------------------------------
    // Connection à la base de données.
    //-------------------------------------------------------
     
    private void Open()
    {
    try
    {
    con = DriverManager.getConnection(url,login,password);
    }
    catch(Exception e)
    {
    System.out.println("echec d'ouverture:"+e.getMessage());
    }
    }
     
    //-------------------------------------------------------
    // Fonction de formatage de Double au centième.
    //-------------------------------------------------------
     
    static final String ZEROES = "000000000000";
    static final String BLANKS = " ";
     
    static String format( double val, int n, int w)
    {
    double incr = 0.5;
    for( int j=n; j>0; j--) incr /= 10;
    val += incr;
     
    String s = Double.toString(val);
    int n1 = s.indexOf('.');
    int n2 = s.length() - n1 - 1;
     
    if (n>n2) s = s+ZEROES.substring(0, n-n2);
    else if (n2>n) s = s.substring(0,n1+n+1);
     
    if( w>0 & w>s.length() ) s = BLANKS.substring(0,w-s.length()) + s;
    else if ( w<0 & (-w)>s.length() )
    {
    w=-w;
    s = s + BLANKS.substring(0,w-s.length()) ;
    }
     
    return s;
    }
     
     
    //-------------------------------------------------------
    // Calcul du taux d'inscrit par service.
    //-------------------------------------------------------
     
    private int NombrePotentielIncrit(int service)
    {
    Database();
    Open();
     
    int nbrInscritP = 0;
     
    try
    {
    String sql = "SELECT COUNT(ID_usager) AS nb_inscription_potentielle " +
    "FROM usager, service WHERE (Age_min_service<=ROUND(DATEDIFF(NOW(),Date_naissance)/365.25,0)" +
    "<=Age_max_service) AND ID_service=" + service + ";";
    Statement stmt = con.createStatement();
    ResultSet r = stmt.executeQuery(sql);
    
    while (r.next())
    {
    nbrInscritP = r.getInt(1);
    }
    
    con.close();
    }
    catch (SQLException ex)
    {
    
    }
    
    return nbrInscritP;
    }
    
    private int NombreInscrit(int service)
    {
    Database();
    Open();
    int nbrInscrit = 0;
    
    try
    {
    String sql = "SELECT COUNT(*) FROM inscription WHERE id_service = " + service + ";";
    Statement stmt = con.createStatement();
    ResultSet r = stmt.executeQuery(sql);
    
    while (r.next())
    {
    nbrInscrit = r.getInt(1);
    }
    con.close();
    }
    catch (SQLException ex) {
    
    }
    return nbrInscrit;
    }
    
    public String tauxInscriptionService(int service)
    {
    double taux = 0;
    double nbrPI = 0;
    double nbrI = 0;
    
    nbrPI = new Double(NombrePotentielIncrit(service));
    nbrI = new Double(NombreInscrit(service));
    
    taux = (nbrI / nbrPI)*100;
    
    String s = format(taux,2,1);
    
    return s;
    }
    
    //------------------------------------------------------------------
    // Fonction de calcul du Taux de personnes ayant réglé la cantine.
    //------------------------------------------------------------------
    
    private int NombreInscritRegles()
    {
    Database();
    Open();
    
    int nbrInscritR = 0;
    
    try
    {
    String sql = "SELECT COUNT(*) FROM inscription, inscription_usager " +
    "WHERE inscription.ID_inscription_usager= inscription_usager.ID_inscription_usager " +
    "AND YEAR( Date_paiement_periode ) = YEAR( Date_dernier_paiement ) " +
    "AND (MONTH( Date_dernier_paiement ) = MONTH( Date_paiement_periode ) " +
    "OR (MONTH( Date_dernier_paiement )-1) = MONTH( Date_paiement_periode )) " +
    "AND (01 <= DAY( Date_dernier_paiement ) <= 03) AND ID_service = 5;";
    
    Statement stmt = con.createStatement();
    
    ResultSet r = stmt.executeQuery(sql);
    
    while(r.next())
    {
    nbrInscritR = r.getInt(1);
    }
    
    con.close();
    }
    catch (SQLException ex) {
    
    }
    return nbrInscritR;
    }
    
    public String tauxPaiementsCantineRegles()
    {
    double taux = 0;
    double nbrI = 0;
    double nbrIR = 0;
    
    nbrI = new Double(NombreInscrit(5));
    
    nbrIR = new Double(NombreInscritRegles());
    
    taux = (nbrIR / nbrI)*100;
    
    String s = format(taux,2,1);
    
    return s;
    }
    
    //------------------------------------------------------------------
    // Fonction de calcul du Taux de personnes étant en retard pour
    // le paiment de la cantine.
    //------------------------------------------------------------------
    
    public String tauxPaiementsCantineRetard()
    {
    double taux = 0;
    double nbrI = 0;
    double nbrIR = 0;
    double nbrINR = 0;
    
    nbrI = new Double(NombreInscrit(5));
    
    nbrIR = new Double(NombreInscritRegles());
    
    nbrINR = nbrI - nbrIR;
    
    taux = (nbrINR / nbrI)*100;
    
    String s = format(taux,2,1);
    
    return s;
    }
    
    
    //---------------------------------------------------------------------------
    // Fonction de calcul du Taux de paiement de la cantine non réglé à l'année.
    //---------------------------------------------------------------------------
    
    private int NombreInscritNonReglesAnnee(int annee)
    {
    Database();
    Open();
    
    int nbrInscritNR = 0;
    try
    {
    String sql = "SELECT SUM(nb_non_paiement) FROM non_paiement" +
    " WHERE YEAR(Date)=" + annee + ";";
    Statement stmt = con.createStatement();
    ResultSet r = stmt.executeQuery(sql);
    while(r.next())
    {
    nbrInscritNR = r.getInt(1);
    }
    
    con.close();
    }
    catch (SQLException ex) {
    
    }
    
    return nbrInscritNR;
    }
    
    private int NombreInscritAnnee(int annee)
    {
    Database();
    Open();
    
    int nbrInscritAnnee = 0;
    try
    {
    String sql = "SELECT SUM(nb_personne_inscrite) FROM non_paiement" +
    " WHERE YEAR(Date)=" + annee + ";";
    Statement stmt = con.createStatement();
    ResultSet r = stmt.executeQuery(sql);
    while(r.next())
    {
    nbrInscritAnnee = r.getInt(1);
    }
    
    con.close();
    }
    catch (SQLException ex) {
    
    }
    return nbrInscritAnnee;
    }
    
    public String tauxPaiementsCantineNonRegles(int annee)
    {
    double taux = 0;
    double nbrI = 0;
    double nbrINR = 0;
    
    nbrI = new Double(NombreInscritAnnee(annee));
    
    nbrINR = new Double(NombreInscritNonReglesAnnee(annee));
    
    taux = (nbrINR / nbrI)*100;
    
    String s = format(taux,2,1);
    
    return s;
    }
    }

Discussions similaires

  1. Réponses: 2
    Dernier message: 10/09/2008, 14h01
  2. utilisation d'integration services
    Par freestyler dans le forum MS SQL Server
    Réponses: 5
    Dernier message: 07/05/2007, 02h36
  3. [Web Service]Axis2 + Rampart
    Par xino_ dans le forum Services Web
    Réponses: 4
    Dernier message: 08/03/2007, 11h28
  4. utilisation des grids services
    Par weldata dans le forum Autres Logiciels
    Réponses: 2
    Dernier message: 18/10/2006, 09h15
  5. [Axis] Utilisation d'un service soap avec Axis.
    Par avalone dans le forum Services Web
    Réponses: 3
    Dernier message: 14/02/2006, 15h17

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