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

Windows Communication Foundation .NET Discussion :

Hébergement WCF et acces au service


Sujet :

Windows Communication Foundation .NET

  1. #1
    Membre du Club
    Homme Profil pro
    Ingénieur c++ junior
    Inscrit en
    Mai 2013
    Messages
    35
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 31
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Ingénieur c++ junior
    Secteur : Santé

    Informations forums :
    Inscription : Mai 2013
    Messages : 35
    Points : 41
    Points
    41
    Par défaut Hébergement WCF et acces au service
    Bonjour à tous,
    J'ai développé une petite application ( à l'aide d'un tutoriel) avec un web service WCF, une database et un client WPF. Tout marche très bien lorsque j'utilise ma base et mon service en local dans mon app.config :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     <endpoint address="http://localhost:59561/FichesClientsService.svc"
                    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IFichesClientService"
                    contract="FichesClientsService.IFichesClientService" name="BasicHttpBinding_IFichesClientService" />
            </client>
    J'ai ensuite hébergé mon wcf sur mon serveur IIS à l'aide du gestionnaire de service internet à windows 10. Lorsque j'accède à l'adresse 127.0.0.1 avec mon broswer j'ai bien accès au service hébergé.
    J'ai ensuite changé dans mon app.config la provenance du service en remplaçant localhost:59561 par 127.0.0.1.
    depuis j'ai erreur lorsque je veux récupérer mes data :/
    Je ne sais pas du tout d'où ca vient et j'aimerai des conseil pour résoudre ce problème
    mon code est hébergé ici pour ceux qui voudraient y jeter un oeil : https://github.com/apitaud/ApplicationConnect-e.git

    Merci à tous
    Cordialement, Psykomusic
    Images attachées Images attachées    

  2. #2
    Membre confirmé Avatar de WaterTwelve21
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Décembre 2015
    Messages
    270
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Décembre 2015
    Messages : 270
    Points : 461
    Points
    461
    Par défaut
    Bonjour , peux tu nous montrer les détails de l'exception s'il te plait ? View Details >> Message
    throw new NoSignatureException();

  3. #3
    Membre du Club
    Homme Profil pro
    Ingénieur c++ junior
    Inscrit en
    Mai 2013
    Messages
    35
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 31
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Ingénieur c++ junior
    Secteur : Santé

    Informations forums :
    Inscription : Mai 2013
    Messages : 35
    Points : 41
    Points
    41
    Par défaut
    Alors, après quitter et re-ouvert mon projet, j'ai maintenant des erreurs un peu plus expressives.
    J'ai une exception qui me dit :

    Error Could not find default endpoint element that references contract 'FichesClientsService.IFichesClientService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element. GestionFichesClients J:\ProjetVS\MaPremiereApplicationConnectee\GestionFichesClients\MainWindow.xaml 10
    la ligne 10 étant
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
        <Window.DataContext>
            <local:FichesClientsVM />
        </Window.DataContext>
    Et lors de l’exécution j'ai une deuxième erreur :
    L'invocation du constructeur sur le type 'GestionFichesClients.FichesClientsVM' qui correspond aux contraintes de liaison spécifiées a levé une exception.' numéro de ligne '10' et position de ligne '10'.

    Merci de ton aide

  4. #4
    Membre confirmé Avatar de WaterTwelve21
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Décembre 2015
    Messages
    270
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Décembre 2015
    Messages : 270
    Points : 461
    Points
    461
    Par défaut
    Vérifie que tu n'ai pas oublié d'ajouter ton service dans le web.config de ton projet , et dans le reference.svcmap .
    throw new NoSignatureException();

  5. #5
    Membre du Club
    Homme Profil pro
    Ingénieur c++ junior
    Inscrit en
    Mai 2013
    Messages
    35
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 31
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Ingénieur c++ junior
    Secteur : Santé

    Informations forums :
    Inscription : Mai 2013
    Messages : 35
    Points : 41
    Points
    41
    Par défaut
    tu entends quoi par ajouter le service à web.config et à mon svcmap ?
    Désolé si mes questions sont stupides :/ Voici mon fichier web.config:
    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
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections>
     
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
      <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
      <appSettings>
        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
      </appSettings>
      <system.web>
        <compilation debug="true" targetFramework="4.5.2" />
        <httpRuntime targetFramework="4.5.2" />
            <identity impersonate="false" />
            <authentication mode="Windows" />
      </system.web>
      <system.serviceModel>
     
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <protocolMapping>
          <add binding="basicHttpBinding" scheme="http" />
          <add binding="basicHttpsBinding" scheme="https" />
        </protocolMapping>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
        <!--
            To browse web app root directory during debugging, set the value below to true.
            Set to false before deployment to avoid disclosing web app folder information.
          -->
        <directoryBrowse enabled="true" />
            <staticContent>
                <remove fileExtension=".svc" />
                <mimeMap fileExtension=".svc" mimeType="Application/octet-string" />
            </staticContent>
            <handlers>
                <add name="svc-integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler" resourceType="File" preCondition="integratedMode" />
            </handlers>
            <security>
                <requestFiltering>
                    <fileExtensions>
                        <add fileExtension=".svc" allowed="true" />
                    </fileExtensions>
                </requestFiltering>
            </security>
      </system.webServer>
      <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
          <parameters>
            <parameter value="mssqllocaldb" />
          </parameters>
        </defaultConnectionFactory>
        <providers>
          <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
        </providers>
      </entityFramework>
      <connectionStrings>
        <add name="FichesClientsEntities" connectionString="metadata=res://*/FichesClientsDataModel.csdl|res://*/FichesClientsDataModel.ssdl|res://*/FichesClientsDataModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\MSSQLLocalDB;attachdbfilename=|DataDirectory|\FichesClients.mdf;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
      </connectionStrings>
      <system.diagnostics>
        <trace autoflush="true" />
        <sources>
          <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
            <listeners>
              <add name="sdt" type="System.Diagnostics.XmlWriterTraceListener" initializeData="SdrConfigExample.e2e" />
            </listeners>
          </source>
        </sources>
      </system.diagnostics>
    </configuration>

  6. #6
    Membre du Club
    Homme Profil pro
    Ingénieur c++ junior
    Inscrit en
    Mai 2013
    Messages
    35
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 31
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Ingénieur c++ junior
    Secteur : Santé

    Informations forums :
    Inscription : Mai 2013
    Messages : 35
    Points : 41
    Points
    41
    Par défaut
    Bonjour,
    j'ai essayé d'ajouter le service dans le web.config en faisant ca
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
        <services>
          <service name="FichesClientWCFService.FichesClientsService">
            <endpoint address="http://127.0.0.1/FichesClientsService.svc" binding="basicHttpBinding" contract="FichesClientWCFService.IFichesClientService" />
          </service>
        </services>
    Et maintenant j'ai une autre erreur :
    Additional information: 'L'invocation du constructeur sur le type 'GestionFichesClients.FichesClientsVM' qui correspond aux contraintes de liaison spécifiées a levé une exception.' numéro de ligne '10' et position de ligne '10'.

    et il me souligne la ligne
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
        <Window.DataContext>
            <local:FichesClientsVM />
        </Window.DataContext>
    de mon MainWindow.xaml
    :/ Merci de ton aide dans tous les cas

  7. #7
    Membre confirmé Avatar de WaterTwelve21
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Décembre 2015
    Messages
    270
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Décembre 2015
    Messages : 270
    Points : 461
    Points
    461
    Par défaut
    Autre question : as tu pensé à updater la référence de ton service ?

    selon cette procédure https://msdn.microsoft.com/fr-fr/library/bb628652.aspx.

    Ton webservice communique entre deux solutions ?
    throw new NoSignatureException();

  8. #8
    Membre du Club
    Homme Profil pro
    Ingénieur c++ junior
    Inscrit en
    Mai 2013
    Messages
    35
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 31
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Ingénieur c++ junior
    Secteur : Santé

    Informations forums :
    Inscription : Mai 2013
    Messages : 35
    Points : 41
    Points
    41
    Par défaut
    j'ai bien update mes références il me dit ok mais quand j’exécute j'ai toujours le même problème
    mon web service communique entre un projet wpf et une base de données que j'ai pour le moment en local dans un fichier mdf.

    Je voulais juste déporté le service sur le serveur iis de ma machine pour essayer ^^

Discussions similaires

  1. Réponses: 0
    Dernier message: 08/01/2013, 15h10
  2. Hébergement sur IIS d'un service WCF
    Par kendras dans le forum Windows Communication Foundation
    Réponses: 0
    Dernier message: 26/07/2010, 11h09
  3. Configuration WCF, accès à un service dans une winform
    Par hirochirak dans le forum Windows Communication Foundation
    Réponses: 1
    Dernier message: 22/02/2010, 15h20
  4. Accès à un service WCF distant
    Par PerpetualSnow dans le forum Silverlight
    Réponses: 4
    Dernier message: 18/12/2009, 11h29
  5. Accès aux services WCF sans paramétrage des adresses dans les endpoint
    Par eric39 dans le forum Windows Communication Foundation
    Réponses: 0
    Dernier message: 25/03/2009, 11h16

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