Configuration WCF, accès à un service dans une winform
Bonjour.
Je suis en train de me battre avec WCF.
Enfin surtout avec la partie configuration.
Voici comment la configuration est faite :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
<system.serviceModel>
<services>
<service name="ARGOS.WCF.Commercial" behaviorConfiguration="ARGOS.WCF.CommercialBehavior">
<endpoint address="" binding="basicHttpBinding" contract="ARGOS.WCF.ICommercial">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ARGOS.WCF.CommercialBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel> |
Côté client voici mon fichier de configuration :
Code:
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
| <?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ICommercial" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:64108/Commercial.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_ICommercial" contract="CommercialServiceReference.ICommercial"
name="BasicHttpBinding_ICommercial" />
</client>
</system.serviceModel>
</configuration> |
Pour la partie configuration cliente, je me suis basé sur les éléments fournis par l'outil svcutil.exe après avoir tester avec la configuration de base lorsqu'on ajoute un service à un projet
J'ai essayé plusieurs trucs pour essayer de faire fonctionner tout ça mais j'avoue que là je ne comprends pas d'où vient l'erreur, en attendant voici ce que me dit Visual Studio :
Citation:
Impossible de trouver un élément de point de terminaison par défaut qui fait référence au contrat « CommercialServiceReference.ICommercial » dans la section de configuration du client ServiceModel. Ceci peut être dû au fait que le fichier de configuration de votre application est introuvable ou que l’élément de point de terminaison correspondant à ce contrat est introuvable dans l’élément client.
Merci d'avance pour votre aide