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 :

[WCF] problème de version HTTP 1.0 / 1.1


Sujet :

Services Web

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2014
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Octobre 2014
    Messages : 7
    Points : 5
    Points
    5
    Par défaut [WCF] problème de version HTTP 1.0 / 1.1
    Bonjour à tous,

    J'ai un service WCF qui tourne sur IIS6. Ce service permet de synchroniser une base SQL Server avec des bases SQL CE (sur client WPF).

    Le problème :
    Tout marche très bien, sauf pour un utilisateur en particulier, qui se connecte via un proxy.
    L'exception levée sur le client est la suivante :
    "Le transfert d'encodage mémorisé en bloc n'est pas pris en charge par le protocole HTTP/1.0"

    Les conditions de reproduction du problème :
    L'exception est levée lorsqu'on fait appel à une fonction du service qui demande des transferts de données.
    Si on exécute par exemple la fonction qui teste si le service est actif (une fonction toute simple qui connecte le service à SQL Server et renvoie un bool) il n'y a aucun problème.

    Le problème semble donc lié à la gestion des paquets par http. Le client a bien accès au service (l'adresse du service est accessible, et autorisée par le proxy, et une des fonctions marche), mais on dirait qu'il y a un souci de version http entre le client et le serveur...
    [EDIT] le message post du client est en http 1.1, et le retour serveur est en http 1.0

    Avez-vous une idée ? Comment peut-on définir la version http du client ou du serveur ? Sachant que les marges de manoeuvre pour modifier le proxy du client sont très limitées car il s'agit d'une grande entreprise avec un service réseau très retors...

    Thx !

  2. #2
    Futur Membre du Club
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2014
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Octobre 2014
    Messages : 7
    Points : 5
    Points
    5
    Par défaut
    Voilà un peu plus d'infos sur le problème, avec un peu de code :

    Le problème vient du proxy qui fonctionne en http1.0, alors que le client est en 1.1
    Pour résoudre ce problème il faudrait que je place ce petit bout de code afin de modifier cette version en 1.0 :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    protected override WebRequest GetWebRequest(Uri uri)
    {
        HttpWebRequest webRequest = (HttpWebRequest) base.GetWebRequest(uri);
     
        webRequest.KeepAlive = false;
        webRequest.ProtocolVersion=HttpVersion.Version10;
        return webRequest;
    }
    Pour ça il me faudrait la classe héritant de 'WebClient' générée normalement lors d'un ajout de référence de service WCF.
    J'ai beau chercher, j'ai l'impression que l'architecture Sync Framework ne me permet pas d'avoir accès à ça. Je ne sais pas pourquoi, peut être que tout ça se passe au fin fond des dll du framework...

    Pour info voilà le Reference.cs généré :

    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
    namespace Civin.CivinWCFRef
    {
        using System.Data;
        using Microsoft.Synchronization.Data;
     
     
        [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
        [System.ServiceModel.ServiceContractAttribute(ConfigurationName = "CivinWCFRef.ISyncCivinSyncContract")]
        public interface ISyncCivinSyncContract
        {
     
            [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/ISyncCivinSyncContract/ApplyChanges", ReplyAction = "http://tempuri.org/ISyncCivinSyncContract/ApplyChangesResponse")]
            [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)]
            SyncContext ApplyChanges(SyncGroupMetadata groupMetadata, System.Data.DataSet dataSet, SyncSession syncSession);
     
            [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/ISyncCivinSyncContract/GetChanges", ReplyAction = "http://tempuri.org/ISyncCivinSyncContract/GetChangesResponse")]
            [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)]
            SyncContext GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession);
     
            [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/ISyncCivinSyncContract/GetSchema", ReplyAction = "http://tempuri.org/ISyncCivinSyncContract/GetSchemaResponse")]
            [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)]
            SyncSchema GetSchema(string[] tableNames, SyncSession syncSession);
     
            [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/ISyncCivinSyncContract/GetServerInfo", ReplyAction = "http://tempuri.org/ISyncCivinSyncContract/GetServerInfoResponse")]
            [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)]
            SyncServerInfo GetServerInfo(SyncSession syncSession);
     
            [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/ISyncCivinSyncContract/GetServerChanges", ReplyAction = "http://tempuri.org/ISyncCivinSyncContract/GetServerChangesResponse")]
            [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)]
            string[] GetServerChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession);
     
            [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/ISyncCivinSyncContract/Genere_ID_Synchro", ReplyAction = "http://tempuri.org/ISyncCivinSyncContract/Genere_ID_SynchroResponse")]
            [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)]
            string[] Genere_ID_Synchro(SyncGroupMetadata groupMetadata, SyncSession syncSession);
     
            [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/ISyncCivinSyncContract/TestConnect", ReplyAction = "http://tempuri.org/ISyncCivinSyncContract/TestConnectResponse")]
            [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)]
            string[] TestConnect(SyncGroupMetadata groupMetadata, SyncSession syncSession);
     
        }
     
        [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
        public interface ISyncCivinSyncContractChannel : Civin.CivinWCFRef.ISyncCivinSyncContract, System.ServiceModel.IClientChannel
        {
        }
     
        [System.Diagnostics.DebuggerStepThroughAttribute()]
        [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
        public partial class SyncCivinSyncContractClient : System.ServiceModel.ClientBase<Civin.CivinWCFRef.ISyncCivinSyncContract>, Civin.CivinWCFRef.ISyncCivinSyncContract
        {
     
            public SyncCivinSyncContractClient()
            {
            }
     
            public SyncCivinSyncContractClient(string endpointConfigurationName) :
                base(endpointConfigurationName)
            {
            }
     
            public SyncCivinSyncContractClient(string endpointConfigurationName, string remoteAddress) :
                base(endpointConfigurationName, remoteAddress)
            {
            }
     
            public SyncCivinSyncContractClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
                base(endpointConfigurationName, remoteAddress)
            {
            }
     
            public SyncCivinSyncContractClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
                base(binding, remoteAddress)
            {
            }
     
            public SyncContext ApplyChanges(SyncGroupMetadata groupMetadata, System.Data.DataSet dataSet, SyncSession syncSession)
            {
                return base.Channel.ApplyChanges(groupMetadata, dataSet, syncSession);
            }
     
            public SyncContext GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)
            {
                return base.Channel.GetChanges(groupMetadata, syncSession);
            }
     
            public SyncSchema GetSchema(string[] tableNames, SyncSession syncSession)
            {
                return base.Channel.GetSchema(tableNames, syncSession);
            }
     
            public SyncServerInfo GetServerInfo(SyncSession syncSession)
            {
                return base.Channel.GetServerInfo(syncSession);
            }
     
            public string[] GetServerChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)
            {
                return base.Channel.GetServerChanges(groupMetadata, syncSession);
            }
     
            public string[] Genere_ID_Synchro(SyncGroupMetadata groupMetadata, SyncSession syncSession)
            {
                return base.Channel.Genere_ID_Synchro(groupMetadata, syncSession);
            }
     
            public string[] TestConnect(SyncGroupMetadata groupMetadata, SyncSession syncSession)
            {
                return base.Channel.TestConnect(groupMetadata, syncSession);
            }
        }
    }
    Merci pour votre savoir, peuple du forum

  3. #3
    Futur Membre du Club
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2014
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Octobre 2014
    Messages : 7
    Points : 5
    Points
    5
    Par défaut
    J'ai du nouveau :
    En modifiant le mode de transfert dans les fichier config client en serveur, j'ai pu épurer le problème d'erreur proxy :

    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
    <bindings>
          <basicHttpBinding>
            <binding name="basicHttpBinding" closeTimeout="00:45:00" openTimeout="00:45:00"
              receiveTimeout="00:45:00" sendTimeout="00:45:00" allowCookies="false"
              bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
              messageEncoding="Text" textEncoding="utf-8" transferMode="StreamedResponse"
              useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              <security mode="None">
                <transport clientCredentialType="None" realm="" />
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>
    J'ai modifié tranfertMode de 'Streamed' à 'StreamedResponse' ce qui permet d'éviter de produire les 'Transfer-Encoding: chunked' dans les messages HTTP, qui faisaient râler le proxy (proxy squid 3.1.20 pour info).

    But wait ! There's more !

    Résoudre ça a révélé un problème sous jacent. La synchro bloque au début (~14%) avec l'exception suivante :

    Une exception a été levée par la cible d'un appel. Il n'existait pas de point de terminaison à l'écoute sur http://xxxxxx.yyyyy.com/ProjetWCF.zzzzzzz.svc pouvant axcepter le message. Ceci est souvent dû à une adresse ou une action SOAP incorrecte. Inner Exception : Le serveur distant a retourné une erreur : (404) introuvable]

    Evidemment j'ai ce problème uniquement en passant par squid. Quand on lance le traitement autre part, sur mon réseau ou sur internet, pas de souci.

    Une idée ?

  4. #4
    Futur Membre du Club
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2014
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Octobre 2014
    Messages : 7
    Points : 5
    Points
    5
    Par défaut
    Mieux vaut tard que jamais,
    le problème a été résolu en modifiant une adresse dans un fichier généré... Il s'agit du fichierservice.wsdl, il fallait remplacer l'adresse localhost en fin de fichier par l'adresse du service...
    Je n'ai pas plus d'explication que ça, mais c'est ça qui a résolu ce dernier problème.

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

Discussions similaires

  1. Erreur 1064 - Probléme de versions
    Par thibaut06 dans le forum Requêtes
    Réponses: 2
    Dernier message: 12/11/2005, 16h22
  2. Problème compilation Version 8.0.1 sous Debian Sarge
    Par LIndien dans le forum PostgreSQL
    Réponses: 1
    Dernier message: 04/02/2005, 21h38
  3. [Word] Problème de version Word
    Par delphicrous dans le forum API, COM et SDKs
    Réponses: 3
    Dernier message: 17/09/2004, 11h19
  4. Problèmes de versions avec Xalan, Xerces et Java
    Par honeyz dans le forum XML/XSL et SOAP
    Réponses: 4
    Dernier message: 05/06/2003, 10h18

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