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

Services Web Discussion :

La connexion a été interrompue de manière inattendue ?


Sujet :

Services Web

  1. #1
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2012
    Messages
    55
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2012
    Messages : 55
    Points : 21
    Points
    21
    Par défaut La connexion a été interrompue de manière inattendue ?
    Bonjour à tous,

    J'ai un problème de connexion avec mon service.
    J'ai une méthode qui retourne un boolean. Tout marchait correctement quand je l'appelle.

    Cependant je l'ai redéfini pour renvoyer un "converter" et là, j'ai cette erreur que je ne comprends pas:



    Voici le code d'origine:
    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
    Public Function Read() As Boolean Implements IService1.Read
            Try
                Dim dtmCurrentDate As DateTime = DateTime.Now
                Dim connection As New clsConnectionBD()
                connection.ConnectionString = "Data Source=NICOLEDE;Persist Security Info=True;User ID=metaV5;Password=metaV5;"
                connection.Type = clsConnectionBD.BDDType.Oracle
                _configMA.PathMeta = "C:\DEV_5\Meta Analysis Dev\"
                _configMA.TypeAppli = clsAppli.Type.MetaService
                '_configMA.PathMeta = "C:\DEV_5\Meta Analysis Dev\"
                connection.Open()
                If connection.IsConnected = False Then
                    _elgEvent.WriteEntry("Connexion à la base impossible : " + connection.ConnectionString, EventLogEntryType.Error)
                    Return False
                End If
                Dim reader As DbDataReader
                reader = connection.ExecSelectToDR("SELECT IDE_PLN, ALIAS, DAYS, HOURS, IDE_PRJ,APPLICATION, ARGS, IDE_LANG, USR_LOG_PLN, USR_LOG_EXE FROM T_PLN")
                Dim noAppli As Boolean = False
                If reader.HasRows = True Then
                    Do While reader.Read()
                        Dim converter As clsConverterRunner = Nothing
                        noAppli = False
                        Select Case reader("APPLICATION").ToString()
                            'Ajouter les connectivités ici.
                            Case BOXIUNV_APPLICATION
                                converter = New clsBOXIUnvConverterRunner(_elgEvent)
                            Case BOXIDOC_APPLICATION
                                converter = New clsBOXIDocConverterRunner(_elgEvent)
                            Case ORACLE_APPLICATION
                                converter = New clsOracleConverterRunner(_elgEvent)
                            Case SQLSERVER_APPLICATION
                                converter = New clsSQLServerConverterRunner(_elgEvent)
                            Case SYBASEIQ_APPLICATION
                                converter = New clsSyBaseIQConverterRunner(_elgEvent)
                            Case DELETE_APPLICATION
                                converter = New clsPlanifDeleteLogRunner(_elgEvent)
                            Case GENIO_APPLICATION
                                converter = New clsGenioConverterRunner(_elgEvent)
                            Case POWER_AMC_APPLICATION
                                converter = New clsPowerAmcConverterRunner(_elgEvent)
                            Case COGNOS_APPLICATION
                                converter = New clsCognosConverterRunner(_elgEvent)
                            Case TALEND_APPLICATION
                                converter = New clsTalendConverterRunner(_elgEvent)
                            Case Else
                                noAppli = True
                        End Select
                        If noAppli = False Then
                            converter.ConfigMA = _configMA
                            converter.IdePln = reader("IDE_PLN").ToString()
                            converter.AliasName = reader("ALIAS").ToString()
                            converter.IdePrj = reader("IDE_PRJ").ToString()
                            converter.Days = reader("DAYS").ToString()
                            If converter.IsStartNow Then
                                converter.UserLoginExe = reader("USR_LOG_EXE").ToString()
                            End If
                            converter.Hours = reader("HOURS").ToString()
                            converter.IdeLangue = reader("IDE_LANG").ToString()
                            converter.UserLoginPln = reader("USR_LOG_PLN").ToString()
     
                            If converter.InitWith(reader("ARGS").ToString()) Then
                                If converter.IsOkToConvert(dtmCurrentDate) Then
                                    updateDaysStatus(converter)
                                    If Not FifoContains(converter) Then
                                        _fifoConverterRunners.Enqueue(converter)
                                    End If
                                End If
                            End If
                        End If
                    Loop
                End If
                connection.Close()
                Return True
            Catch ex As Exception
                _elgEvent.WriteEntry(ex.Message + " " + ex.StackTrace, EventLogEntryType.Error)
            End Try
        End Function
    Et le code modifié:
    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
    Public Function Read() As clsConverterRunner Implements IService1.Read
            Try
                Dim dtmCurrentDate As DateTime = DateTime.Now
                Dim connection As New clsConnectionBD()
                connection.ConnectionString = "Data Source=NICOLEDE;Persist Security Info=True;User ID=metaV5;Password=metaV5;"
                connection.Type = clsConnectionBD.BDDType.Oracle
                _configMA.PathMeta = "C:\DEV_5\Meta Analysis Dev\"
                _configMA.TypeAppli = clsAppli.Type.MetaService
                '_configMA.PathMeta = "C:\DEV_5\Meta Analysis Dev\"
                connection.Open()
                If connection.IsConnected = False Then
                    _elgEvent.WriteEntry("Connexion à la base impossible : " + connection.ConnectionString, EventLogEntryType.Error)
                    '  Return False
                End If
                Dim reader As DbDataReader
                reader = connection.ExecSelectToDR("SELECT IDE_PLN, ALIAS, DAYS, HOURS, IDE_PRJ,APPLICATION, ARGS, IDE_LANG, USR_LOG_PLN, USR_LOG_EXE FROM T_PLN")
                Dim noAppli As Boolean = False
                Dim converter As clsConverterRunner = Nothing   'visibilité du converter -> valeur de retour
                If reader.HasRows = True Then
                    Do While reader.Read()
                        ' Dim converter As clsConverterRunner = Nothing
                        noAppli = False
                        Select Case reader("APPLICATION").ToString()
                            'Ajouter les connectivités ici.
                            Case BOXIUNV_APPLICATION
                                converter = New clsBOXIUnvConverterRunner(_elgEvent)
                            Case BOXIDOC_APPLICATION
                                converter = New clsBOXIDocConverterRunner(_elgEvent)
                            Case ORACLE_APPLICATION
                                converter = New clsOracleConverterRunner(_elgEvent)
                            Case SQLSERVER_APPLICATION
                                converter = New clsSQLServerConverterRunner(_elgEvent)
                            Case SYBASEIQ_APPLICATION
                                converter = New clsSyBaseIQConverterRunner(_elgEvent)
                            Case DELETE_APPLICATION
                                converter = New clsPlanifDeleteLogRunner(_elgEvent)
                            Case GENIO_APPLICATION
                                converter = New clsGenioConverterRunner(_elgEvent)
                            Case POWER_AMC_APPLICATION
                                converter = New clsPowerAmcConverterRunner(_elgEvent)
                            Case COGNOS_APPLICATION
                                converter = New clsCognosConverterRunner(_elgEvent)
                            Case TALEND_APPLICATION
                                converter = New clsTalendConverterRunner(_elgEvent)
                            Case Else
                                noAppli = True
                        End Select
                        If noAppli = False Then
                            converter.ConfigMA = _configMA
                            converter.IdePln = reader("IDE_PLN").ToString()
                            converter.AliasName = reader("ALIAS").ToString()
                            converter.IdePrj = reader("IDE_PRJ").ToString()
                            converter.Days = reader("DAYS").ToString()
                            If converter.IsStartNow Then
                                converter.UserLoginExe = reader("USR_LOG_EXE").ToString()
                            End If
                            converter.Hours = reader("HOURS").ToString()
                            converter.IdeLangue = reader("IDE_LANG").ToString()
                            converter.UserLoginPln = reader("USR_LOG_PLN").ToString()
     
                            If converter.InitWith(reader("ARGS").ToString()) Then
                                If converter.IsOkToConvert(dtmCurrentDate) Then
                                    updateDaysStatus(converter)
                                    If Not FifoContains(converter) Then
                                        _fifoConverterRunners.Enqueue(converter)
                                    End If
                                End If
                            End If
                        End If
                        connection.Close()
                        reader.Close()
                        Return converter
                    Loop
                End If
                ' connection.Close()
                ' Return converter
                '   Return True
            Catch ex As Exception
                _elgEvent.WriteEntry(ex.Message + " " + ex.StackTrace, EventLogEntryType.Error)
            End Try
        End Function
    J'ai cherché partout sur le net, impossible de corriger mon erreur.
    Merci d'avance

  2. #2
    Invité
    Invité(e)
    Par défaut
    Ton webService doit contenir une erreur, et il sort sur une exception.

  3. #3
    Inactif  
    Homme Profil pro
    Chef de projet NTIC
    Inscrit en
    Janvier 2007
    Messages
    6 604
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 63
    Localisation : France

    Informations professionnelles :
    Activité : Chef de projet NTIC

    Informations forums :
    Inscription : Janvier 2007
    Messages : 6 604
    Points : 13 314
    Points
    13 314
    Par défaut
    Citation Envoyé par Mady_roar Voir le message
    Bonjour à tous,

    J'ai un problème de connexion avec mon service.
    J'ai une méthode qui retourne un boolean. Tout marchait correctement quand je l'appelle.

    Cependant je l'ai redéfini pour renvoyer un "converter" et là, j'ai cette erreur que je ne comprends pas:
    La définition de l'image est trop faible pour lire quoi que ce soit.

    De plus, tu ne donnes pas la ligne qui lève l'erreur.

  4. #4
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2012
    Messages
    55
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2012
    Messages : 55
    Points : 21
    Points
    21
    Par défaut
    Salut,

    Tu peux cliquer sur l'image pour l'agrandir
    La ligne qui lève l'exception est surlignée.

  5. #5
    Inactif  
    Homme Profil pro
    Chef de projet NTIC
    Inscrit en
    Janvier 2007
    Messages
    6 604
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 63
    Localisation : France

    Informations professionnelles :
    Activité : Chef de projet NTIC

    Informations forums :
    Inscription : Janvier 2007
    Messages : 6 604
    Points : 13 314
    Points
    13 314
    Par défaut
    Citation Envoyé par Mady_roar Voir le message
    Salut,

    Tu peux cliquer sur l'image pour l'agrandir
    La ligne qui lève l'exception est surlignée.
    En effet, maintenant ça marche : ce n'était pas le cas quand j'ai essayé avant.

  6. #6
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2012
    Messages
    55
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2012
    Messages : 55
    Points : 21
    Points
    21
    Par défaut
    J'ai essayé de dépatouiller mon affaire depuis ce matin.. sans résultat
    Je n'arrive pas à saisir d'où vient le pb.

    Edit
    Bon, j'ai réussi à afficher le converter dans mon appli console en le convertissant en string.

    Je me pose donc la question: peut-on renvoyer une classe au lieu de types primitifs tels les string, int & co ?

    Bonne journée à tous.

  7. #7
    Inactif  
    Homme Profil pro
    Chef de projet NTIC
    Inscrit en
    Janvier 2007
    Messages
    6 604
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 63
    Localisation : France

    Informations professionnelles :
    Activité : Chef de projet NTIC

    Informations forums :
    Inscription : Janvier 2007
    Messages : 6 604
    Points : 13 314
    Points
    13 314
    Par défaut
    Citation Envoyé par Mady_roar Voir le message
    Je me pose donc la question: peut-on renvoyer une classe au lieu de types primitifs tels les string, int & co ?
    .
    Du moment que une instance de classe est sérialisable, on peut la renvoyer en retour d'une méthode d'un web service. (avec quelques contraintes, sur les tableaux à dimensions multiples par exemples, mais c'est assez anecdotique).

    Accessoirement, string n'est pas un type primitif (c'est une classe prédéfinie, mais pas un type primitif).

  8. #8
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2012
    Messages
    55
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2012
    Messages : 55
    Points : 21
    Points
    21
    Par défaut
    Merci pour ta réponse.
    Oui tu as raison pour la classe string.. un peu facile mon raccourci

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Connexion interrompu de manière aléatoire (ERROR 101)
    Par Invité dans le forum Administration système
    Réponses: 2
    Dernier message: 23/06/2013, 11h20
  2. [EasyPHP] apache s'est terminé de manière inattendue
    Par sebastien2 dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 1
    Dernier message: 18/05/2010, 15h45
  3. [OL-2010] connexion au serveur interrompue
    Par vg-matrix dans le forum Outlook
    Réponses: 2
    Dernier message: 21/12/2009, 08h31
  4. [SOCKET] comment savoir si la connexion a été interrompue?
    Par adrien1 dans le forum Entrée/Sortie
    Réponses: 1
    Dernier message: 01/11/2009, 20h21
  5. Réponses: 10
    Dernier message: 03/08/2009, 13h57

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