wcf配置:无法添加服务。可能无法访问服务元数据

时间:2016-07-04 11:54:57

标签: c# wcf

我在解决我的wcf服务时遇到了这个问题:

无法添加服务。可能无法访问服务元数据

我的配置:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>

    <behaviors >
      <serviceBehaviors>
        <behavior >
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="ServiceAspNetAjaxBehavior">
          <enableWebScript/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <services>
      <service name="Serv.Service1" behaviorConfiguration="">
        <endpoint address=""  binding="webHttpBinding" contract="Serv.IService1" behaviorConfiguration="ServiceAspNetAjaxBehavior"/>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
             <host>
          <baseAddresses>
            <add baseAddress = "http://localhost:8733/Design_Time_Addresses/Serv/Service1/" />
          </baseAddresses>
        </host>

      </service>

    </services>
  </system.serviceModel>
  </configuration>

和我的合同:

public interface IService1
{

    [OperationContract]
    void Register(string Name, string Email, string Phone, string Password);


    [OperationContract]
    void Reserve(int User_ID, int Table, DateTime Date);


    [OperationContract]
    DataTable Login(string Email, string Password);

    [OperationContract]
    string heck_Email(string Email);

    [OperationContract]
    DataTable Show_History(int User_ID);


    [OperationContract]
    List<Data.Product> Show_P();



    [OperationContract]
    Data.Login Log(string User, string Pass);
}

我试图更改我的配置但它没有工作我仍然得到相同的错误消息帮助请!

0 个答案:

没有答案