Bonjour,

J'ai fait l'exemple "IntroductionWCF" et en Local toit fonctionne bien.
Maintenant je test die un dite serveur (hebergement).
Je copie mon fichier InventaireService.cs dans le repertoire WebServices et ma Dll InventaireServiceLibrairie.dll dans bin.

- Je vois bien mon service :
http://www.sportonic.fr/Webservices/...Inventaire.svc

- J'execute l'utilitaire :
svcutil.exe http://www.sportonic.fr/webservices/...taire.svc?wsdl
Et je recupere les 2 fichierss : aoutput.config et InventaireService.cs

- Je crée un Client windowsform et je fait ajout serviceReferrences , le wcf est reconnue et je voie bien mes methodes.

Dans mon code j'essaye d'ouvrir le service :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
proxy = new InventaireServiceClient("WSHttpBinding_IInventaireService");
        try
        {
            proxy.Open();
        }
        catch (SecurityNegotiationException Ex)
        {
            MessageBox.Show(Ex.Message);
        }
Et il me retourne l'erreur suivante :
L’appelant n’a pas été authentifié par le service.
- Mon hebergeur me dir qu'il n'y a pas de securité speciale :
- Voici mon app.config (ou output.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
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="WSHttpBinding_IInventaireService" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            algorithmSuite="Default" establishSecurityContext="true" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://www.sportonic.fr/webservices/ServiceInventaire.svc"
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IInventaireService"
                contract="IInventaireService" name="WSHttpBinding_IInventaireService">
                <identity>
                    <dns value="www.sportonic.fr:80/Webservices" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
</configuration>
Qu'est ve que j'oublie de fare.
Merci de votre aide.
Anthride