Bonjour à tous, tout d'abord désolé si ce n'est pas le bon endroit pour poser cette question.

Je dois réaliser un travail :

1er étape :
  • j'ai créé un web service WCF avec Visual Studio 2012 (Framework 4.5) nommé "MonWCF".
  • J'ai un second projet (Web Asp.Net) où j'ai mis une référence de "MonWCF", j'ai pu ainsi récupérer les méthodes et afficher les données (récupérées depuis une DataBase Sql Server) dans des Grid ... (ici tout fonctionne bien).


2e étape :
  • pouvoir récupérer ces méthodes depuis le code javascript.
  • J'ai une méthode (getTest()) dans "MonWCF" qui retourne juste un String. J'aimerais faire appel à cette méthode pour commencer par exemple.



Je suis ce tutoriel http://www.codeproject.com/Articles/...s-using-jQuery.

Dans ce tutoriel, on réalise tout dans un même projet (voir les sources ici : http://www.codeproject.com/script/Ar...spx?aid=132809).

Moi, j'ai un projet Web Service WCF et un projet Web Asp.Net qui possède une référence de mon WCF.

Lorsque je lance ma page web, j'obtiens cette erreur :

The message with To 'Http://localhost:62324/Service1.svc/getUser' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.


Je pense que c'est un problème au niveau de mon fichier web.config mais je ne suis pas sur. Quelqu'un pourrait m'aider?

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
<configuration>
    <system.web>
      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
 
    </system.web>
 
    <system.serviceModel>
        <client>
            <endpoint address="http://localhost:52768/Service1.svc" binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_IService1" contract="WebServiceSage100.IService1"
                name="BasicHttpBinding_IService1" />
        </client>
        <behaviors>
            <serviceBehaviors>
                <behavior name="">
                    <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="false" />
                </behavior>
            </serviceBehaviors>
          <endpointBehaviors>
            <behavior name="EndpBehavior">
              <webHttp/>
            </behavior>
          </endpointBehaviors>
        </behaviors>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
            multipleSiteBindingsEnabled="true" />
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IService1" />
            </basicHttpBinding>
        </bindings>
 
      <services>
        <service name="WSSage100.Service1">
          <endpoint address=""  binding="webHttpBinding" contract="WSSage100.IService1">
          </endpoint>
        </service>
      </services>
 
      </system.serviceModel>
</configuration>
Merci.