WCF Web服务找不到引用默认协定的端点元素

时间:2013-03-10 14:18:44

标签: c# wcf service web

我有一台有两项服务的服务器:

  1. ContactServiceIContactService
  2. SessionServiceISessionService
  3. 执行时出错:

      

    “Impossible de trouverunééédedede point de terminaisonpardéfautquifaitréférenceaucontrat   'SessionServiceReference.ISessionService'用于配置客户端ServiceModel。   Cecipeutêtredûaufait que le fichier de configuration de votre application est introuvable ou   que l'élémentdepoint de terminaisonCorresponantàcecontrat est introuvable dans l'élémentclient。“

    我的web.config:

    <?xml version="1.0"?>
    <configuration>
    
      <system.web>
        <authentication mode="Windows"/>
        <compilation debug="true" targetFramework="4.0" />
      </system.web>
      <system.serviceModel>
        <bindings>
          <customBinding>
            <binding name="InstantMessagingBinding" closeTimeout="00:10:00">
              <textMessageEncoding>
                <readerQuotas maxStringContentLength="200000" maxArrayLength="200000" />
              </textMessageEncoding>
              <httpTransport keepAliveEnabled="false" maxReceivedMessageSize="200000" authenticationScheme="Ntlm"/>
            </binding>
          </customBinding>
        </bindings>
        <behaviors>
            <serviceBehaviors>
                <behavior name="InstantMessagingBehavior">
                    <serviceMetadata httpGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="true" />
                </behavior>
                <behavior name="">
                    <serviceMetadata httpGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="false" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
        <services>
          <service name="Isima.InstantMessaging.WcfService.ContactService" behaviorConfiguration="InstantMessagingBehavior">
            <endpoint address=""
              binding="customBinding" bindingConfiguration="InstantMessagingBinding"
              contract="Isima.InstantMessaging.WcfService.IContactService" >
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
          </service>
          <service name="Isima.InstantMessaging.WcfService.SessionService" behaviorConfiguration="InstantMessagingBehavior">
            <endpoint address=""
              binding="customBinding" bindingConfiguration="InstantMessagingBinding"
              contract="Isima.InstantMessaging.WcfService.ISessionService" >
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
          </service>
        </services>
      </system.serviceModel>
     <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
      </system.webServer>
    
    </configuration>
    

    和app.config

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.serviceModel>
        <bindings>
          <customBinding>
            <binding name="CustomBinding_IContactService">
              <textMessageEncoding />
              <httpTransport authenticationScheme="Ntlm" />
            </binding>
            <binding name="CustomBinding_ISessionService">
              <textMessageEncoding />
              <httpTransport authenticationScheme="Ntlm" />
            </binding>
          </customBinding>
        </bindings>
        <client>
          <endpoint address="http://localhost:2984/ContactService.svc"
            binding="customBinding" bindingConfiguration="CustomBinding_IContactService"
            contract="ContactServiceReference.IContactService" name="CustomBinding_IContactService">
            <identity>
              <dns value="localhost" />
            </identity>
          </endpoint>
          <endpoint address="http://localhost:2984/SessionService.svc"
            binding="customBinding" bindingConfiguration="CustomBinding_ISessionService"
            contract="SessionServiceReference.ISessionService" name="CustomBinding_ISessionService">
            <identity>
              <dns value="localhost" />
            </identity>
          </endpoint>
        </client>
      </system.serviceModel>
    </configuration>
    

    为什么会出现此错误?

0 个答案:

没有答案